I am currently using whereIn
for this. But only get 10 or less douments at once. whereIn 10 entries or less according to the firestore documentation
Is there any way to get more than 10 documents at once in one round trip?
return _db
.collection('books')
.where('docId', whereIn: ['id1', 'id2'...'id10'])
.get()
.then((value) => value.docs.map((e) => BookModel.fromFireStore(e)).toList());
No, 30 is a hard limit and can't be exceeded. You will need to perform multiple queries to get more than 30 documents by ID. The documentation states:
Use the
in
operator to combine up to 30 equality (==) clauses on the same field with a logical OR.