-
Notifications
You must be signed in to change notification settings - Fork 79
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
Firestore Count() query #353
Comments
@spyr0s if you run the query and store the result, can't you just run the size option on the array? Example
Or am I way off mark here? |
@BearDooks - you should be right, but it might be weird with timing and stuff where it'll not be atomic I guess. I'll have to look into this closer, and am going to do so today while I work on the Firestore huge refactor! |
@WolfgangSenff - It isn't the same, with query and size you will be charged by every document read, instead with count you will be charged 1 read every 1000*index documents. |
Ah, interesting, okay, good point! I will eventually look into it, but just lost my job last week so am looking for a new job now. If you want to support the project and get the implementation sooner, that would be incredibly helpful. We do now support commits, which make atomic updates much cheaper! But it's obviously not the same. I'll post updates about it at https://patreon.com/KyleSzklenski. Edit: Dang. Looking over the query stuff again, I'm tempted to rewrite the entire thing there as well. :/ It would be so much work, but looking at the code, it's more or less completely unmaintainable at this point, no way to add new stuff without breaking the old. |
Alright, had a chance to dig into this, and it seems like it can be fixed without a rewrite. I will try to get to it within the next couple months I guess, if I can find a job that would be even better. |
I've added the appropriate changes, but have not yet made a release. Never the less, I'm closing this for the time being. I'll release it when I have more time available. Fixed in #420 |
Is your feature request related to a problem? Please describe.
I have a problem when I want to get a count of documents of a specific condition
For example get the players that have a score > 10.000, or that signed in after a specific date etc
Describe the solution you'd like
Support the count query of firestore
Describe alternatives you've considered
No alternatives, getting all the documents paginated and count them is out of the question
The text was updated successfully, but these errors were encountered: