Skip to content

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