131
rated 0 times
[
137]
[
6]
/ answers: 1 / hits: 10981
/ 5 Years ago, sat, june 15, 2019, 12:00:00
I have simple fetch data from my Firestore db, but i would like to paginate it with some orderring and where conditions. So i am trying to fetch data with some basic filters, but face error, in docs https://firebase.google.com/docs/firestore/query-data/order-limit-data described that only for range <, <=, >, >= should use orderBy and where for same field, but i need only full match (==)
node v8.12.0, express, firebase functions
model.collection
.orderBy(dateCreated, 'desc')//timeStamp
.where('tenantId', '==', 'f8XnOVUKob5jZ29oM9u9')
.limit(10)
.get()
.then((snapshot) => {
res.send(snapshot);
}).catch((error) => res.send(error));
got next error
{
code: failed-precondition,
name: FirebaseError
}
i have results only when use where or orderBy separetly but not in same time
More From » firebase