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

enhancement: find().count() #313

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

tomcounsell
Copy link

@tomcounsell tomcounsell commented Jul 19, 2022

.find().count() will return a count of the number of matching records for a query.
This returns only the number of results without needing to collect the records.
solves #283

@tomcounsell
Copy link
Author

first attempt at a PR here!
please review and propose changes to match code style and tests.

There was not an obvious way to implement this much needed feature.
Using the AGGREGATE GROUP BY REDUCE feature may not be the best choice. Would love to find a better alternative.

Currently, this implementation is not working for queries where multiple find parameters match the same record. It will count duplicate matches twice. So the current implementation works only for queries with single parameters and the base find().count() use case.

@tomcounsell tomcounsell changed the title add find count to close #283 enhancement: find().count() Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant