Last active
March 11, 2021 22:16
-
-
Save ogawa0071/3577cf0cce00a1e4d6708ed80f4cd896 to your computer and use it in GitHub Desktop.
List Games.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as admin from "firebase-admin"; | |
| admin.initializeApp({ | |
| projectId: "", | |
| }); | |
| const db = admin.firestore(); | |
| (async () => { | |
| const dataArray = ( | |
| await db.collection("games").get() | |
| ).docs.map((queryDocumentSnapshot) => queryDocumentSnapshot.data()); | |
| console.log( | |
| dataArray.map((data) => ({ | |
| id: data.id, | |
| title: data.title, | |
| brandName: data.brandName, | |
| })) | |
| ); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment