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

[FR] Count documents in collection #908

Open
viktoryoo opened this issue Jan 31, 2024 · 2 comments
Open

[FR] Count documents in collection #908

viktoryoo opened this issue Jan 31, 2024 · 2 comments

Comments

@viktoryoo
Copy link

I'm frustrating with the inability to count my documents in a collection. it is described here that in Java you can count the documents when you get the CollectionReference and execute the count().get().get().getCount() . I'm using version 3.9.0 of com.google.cloud:google-cloud-firestore and there in CollectionReference I don't see any implementation of count(). Also here the class doesn't have the count() method aswell.

So I have a question - will count() be available soon? Also is there any workaround how I can count my documents in my collection? Thank you.

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@viktoryoo viktoryoo changed the title [FR] [FR] Count documents in collection Jan 31, 2024
@dconeybe
Copy link

dconeybe commented Feb 5, 2025

Hi and thank you for the question. I'm curious, have you tried using the count() method on CollectionReference? That method should be defined in the superclass, Query, for example: https://firebase.google.com/docs/reference/kotlin/com/google/firebase/firestore/Query#count()

If count() isn't available that is a serious problem! Could you show me a code snippet where you try to call count() but get a compiler error due to its non-existence?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants