How to get data by multiple values of one field? For example, I have database with posts and I want to query for all posts where blogId is 1 or 2, sorting by timestamp.
collection("posts").whereEqualTo("blogId", "1")
.whereEqualTo("blogId", 2).orderBy("timestamp", Query.Direction.DESCENDING).limit(50)
Code above is not working :(
How to achieve this? Regards :)
Firestore has no
OR
queries. They way you'd do that is by running two queries and splicing them.You could for example:
Try this