Add method for getting list of documents (as objects) from a collection
See original GitHub issueCurrently, if you want to get a list of all documents (as JSON objects) from a collection, you have to
- Call
getDocumentIds(pathToCollection, email, key, projectId)to get the IDs for the collection - Loop through these IDs and combine the
pathToCollectionwith the ID to make the document path. - Call
getDocumentFields(path, email, key, projectId)for each document ID / path to get a JSON object for that document.
This should be combined into a single method.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to add List of Object to Firestore? - Stack Overflow
What you can actually do is create a CustomStep and a CustomSteps Collection. Inside your CustomSteps Document you can create an array of ......
Read more >Get data with Cloud Firestore - Firebase
Get all documents in a collection; Get multiple documents from a collection group. List ... the text explaining the samples refers to the...
Read more >db.collection.insert() — MongoDB Manual
If the collection does not exist, then the insert() method will create the collection. _id Field. If the document does not specify an...
Read more >Adding data | Firestore - Google Cloud
Set the data of a document within a collection, explicitly specifying a document ... the text explaining the samples refers to the Web...
Read more >Collection Methods | Documents | Data Model & Concepts
Looks up the documents in the specified collection using the array of keys provided. All documents for which a matching key was specified...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey @grahamearley, we recently did a Hackathon and added query support to this library. I’ll hopefully send a PR with this functionality soon, and it will allow you to get multiple documents from a collection easily. This has the big advantage of doing a single URLFetch instead of O(n) URLFetches.
Right now, I’m thinking the method call will look very much like the “get” method, but will have a param called “query” instead of “path” that will be a Firestore StructuredQuery.
I’m thinking it will look something like this:
Covered by #28 and released in v16!