cachapa / firedart

A dart-native implementation of the Firebase Auth and Firestore SDKs
https://pub.dev/packages/firedart
Apache License 2.0
174 stars 62 forks source link

firestore.collection('Collection_name').get() only returns 20 items #15

Closed diegoveloper closed 4 years ago

diegoveloper commented 4 years ago

Hello, thanks for create this package.

I'm using the latest version from pub.dev firedart: 0.6.5 But I have an issue related to the limit of the documents from any collection.

I tried with different collections and the maximum items returned are 20. Are there any limit/restrictions about that?

This is my implementation:

  final firebaseAuth = FirebaseAuth(apiKey, VolatileStore());
  final firestore = Firestore(projectId, auth: firebaseAuth);
  await firebaseAuth.signIn(email, password);
  final t = await firestore.collection('Airport').get();
  print("T: ${t.length}");

I tried with different collections and the maximum number of documents returned is 20.

cachapa commented 4 years ago

Hey, thanks for the report.

Apparently Firestore defaults to a page size of 20 items. I wasn't aware of that since my collections tend to be a lot smaller than that.

Simply bumping the page size value seems to work fine but the correct fix is a bit more involved since you need to return the paging metadata so you can issue continuation calls.

I'll try to work on it quickly and publish an update when finished.

cachapa commented 4 years ago

The issue is fixed and I've published to pub.dev with version 0.7.0

Thanks again for the report!

diegoveloper commented 4 years ago

Awesome! thanks for the quickly response! it's working fine now! Thanks