Closed devoteappdevelopment closed 1 year ago
This sounds like a hard limitation in the Firebase API, I don't think you can get around it.
If you want to retrieve all of your documents you'll have to iterate through all the pages. Beware that it might have a strong effect on your quota and/or billing.
Thank you for the reply.
For anyone else with the same problem: turns out the query approach doesn't have such a limit.
var theseConstituenciesData = await countriesCollectionReference .document(countryDocId!).collection('constituencies').where('title', isGreaterThan: 'A') .get()
grabs all of the documents.
Weird, but good to know, thanks
Hi, I am trying to get all of the documents in a collection with:
var theseConstituenciesData = await countriesCollectionReference .document(countryDocId!) .collection('constituencies') .get();
however, the result is always truncated to 300 items. I think it might be related to this issue arising in ListDocuments : https://github.com/googleapis/nodejs-firestore/issues/1342 .
I thought of experimenting with just calling the same function multiple times, but there is no command analagous to "startAfterDocument" that appears in the original firestore/firebase packages so I'm not sure how to grab a different set of 300 items in each call.
I tried setting pageSize very high:
var theseConstituenciesData = await countriesCollectionReference .document(countryDocId!) .collection('constituencies') .get(pageSize: 1000000);
but I still get back 300 documents. How can I get all of the documents when there may 1000's or 10,000's of documents?
Thank you