Read multiple documents
To read multiple documents in a collection, you'll need a reference to that collection.
Once you have a reference, you can use the get
method to fetch a snapshot of that collection, which will contain snapshots for all of the documents in that collection.
Filter documents by properties
When building a reference to a collection, you can add queries to the reference which can limit the data returned by the reference. To add a query, use the where
method on a collection reference.
You can add multiple queries by calling where
multiple times. These queries are applied as AND
queries. OR
queries are not possible with the SDK at this time.
Available filter options
The following values can be used for the comparator (the second parameter) of the call to where
...
Value | Description |
| Finds documents where |
| Finds documents where |
| Finds documents where |
| Finds documents where |
| Finds documents where |
| Finds documents where |
| Finds documents where an array, |
| Finds documents where an array, |
| Finds documents where |
| Finds documents where |
Order returned documents
You can change the order documents are returned to you in a snapshot by calling the orderBy
function on the reference.
Limit the number of documents returned
By default, only the first 1000 documents will be returned in a snapshot. You can change this by calling the limit
function on the reference.
By default, there is no server-enforced upper limit for the number of documents that can be returned in a query. Performance may suffer with large limit values.
Last updated