astrojams1
astrojams1

Reputation: 1591

How to query firestore from the command line as admin

How do I authenticate as admin from the command line to dump out / query the data in my firestore? Example, I have a users collection where each document looks like:

{
  edit_count: 15
}

I simply want to print all these documents as json in my terminal.

I've used firebase-tools, but it looks like it's only supporting querying of the RTDB?

Upvotes: 32

Views: 13623

Answers (3)

Galactus
Galactus

Reputation: 826

While waiting for firebase-tools to support more firestore commands, I wrote a basic firestore client that you might find useful:

https://github.com/sgarciac/fuego

Upvotes: 16

giammin
giammin

Reputation: 18958

At the moment (July 2018) Firebase CLI supports database commands (get, set, push etc etc) only for the Realtime Database probably due to Firestore beeing in beta.

Hopefully it will support it later.

Upvotes: 12

astrojams1
astrojams1

Reputation: 1591

Read the documentation here: https://firebase.google.com/docs/admin/setup

This will teach you how to set up local auth to your firestore data.

Upvotes: -14

Related Questions