'Firebase Firestore Query based on filters
Let's say I have a collection of 2000 documents with fields id, age, location in cloud firestore.
On client side(nodejs), I have 50 ids and want to perform a query on the firestore only for these 50 ids and should satisfy the conditions like age>25, location=chicago. I don't want to read all 50 documents. Want to read the documents from these 50 ids which satisfies the conditions I mentioned (The resulting documents could be less than 50) trying to reduce read operations. Is it possible to do this? Looking at the documentation I see there is in operator but my understanding is it only supports for 10 comparison values. Is it possible to query as per my requirement?
While creating the documents, I can adjust the documentId to be the field id if that makes the query possible.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
