Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCountFromServer not supported #6654

Closed
goleary opened this issue Nov 3, 2022 · 3 comments · Fixed by #6668
Closed

getCountFromServer not supported #6654

goleary opened this issue Nov 3, 2022 · 3 comments · Fixed by #6668
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@goleary
Copy link

goleary commented Nov 3, 2022

This was released in 9.11.0 on Oct 6th:

Added getCountFromServer() (getCount() in the Lite SDK), which fetches the number of documents in the result set without actually downloading the documents.

https://firebase.google.com/support/release-notes/js#cloud-firestore_1

I'd love to be able to use this in React Native Firebase

@goleary goleary added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Nov 3, 2022
@mikehardy
Copy link
Collaborator

getCount was added I think in v16.1 here, it is up and running

@goleary
Copy link
Author

goleary commented Nov 4, 2022

Got it. I searched through the docs and found nothing, and also searched the repo and found nothing for getCountFromServer.

Digging through the code I've found the PR where it was added.

Curious why collectionRef.count() was the chosen syntax? The firebase-js sdk uses getCountFromServer() which makes it clear why one would want to use this method (docs are not needlessly transmitted to the client).

Does .count() behave the same?

@mikehardy
Copy link
Collaborator

count() behaves the same, In this case I chose to mirror the work done on FlutterFire (also done by Invertase...) I didn't realize we deviated from the JS API. Something to look in to - I'll reopen it just for naming resolution, perhaps we answer to both APIs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants