Example of a json in my database
request
firestore()
.collection(COLLECTION)
.where("types", ">=", 'lDQJJnsq2osTIWCPLMRg')
.get()
.then(querySnapshot => {
const arr = []
querySnapshot.forEach(documentSnapshot => {
const data = documentSnapshot.data()
const el = {id: documentSnapshot.id, ...data}
arr.push(el)
})
resolve(arr)
})
.catch(err => {
console.log('err ', err )
reject()
});
Filer my collection if the property types containt a id specific I don't find how I add a condition 'where' in the mappage ('types') In my logic, If types containt my id ("lDQJJnsq2osTIWCPLMRg") return this object.
Maybe for mobile, it's better to make a call with pagination, I found the method 'startAt' can help for pagination. It's correct ?
I begin with react-native & firebase, so thanks for help.
For paginating queries you need to use query cursors: https://firebase.google.com/docs/firestore/query-data/query-cursors