Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore: request for a list of collection IDs

[Firestore documentation says:][1]

###Queries other than document reads For queries other than document reads, such as a request for a list of collection IDs, you are billed for one document read. If fetching the complete set of results requires more than one request (for example, if you are using pagination), you are billed once per request.

I cannot find any information of how to perform such queries to get only IDs.

Does anyone know how? [1]: https://firebase.google.com/docs/firestore/pricing#operations

like image 699
ZuzEL Avatar asked Oct 17 '22 22:10

ZuzEL


1 Answers

You can get the collection IDs using the REST API. The documentation is here

You can also return an array of collection IDs with documentRef.getCollections() as detailed here

like image 50
Jason Berryman Avatar answered Nov 15 '22 10:11

Jason Berryman