Skip to content

Instantly share code, notes, and snippets.

@ogawa0071
Last active March 11, 2021 22:16
Show Gist options
  • Select an option

  • Save ogawa0071/3577cf0cce00a1e4d6708ed80f4cd896 to your computer and use it in GitHub Desktop.

Select an option

Save ogawa0071/3577cf0cce00a1e4d6708ed80f4cd896 to your computer and use it in GitHub Desktop.
List Games.
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