-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Implemented Fibers-less MongoDB count methods. #12295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does look good
Do want to squeeze this into 2.8.1? |
It looks more of a minor change. I think it should go on 2.9. |
Yeah, I'd also go with 2.9. There's also no documentation for it yet, and I probably won't find time for that in the next few days. |
I added some documentation, but I'm not sure how to tackle it in general. Meteor never really listed all options in the docs, and now there's just way too many to do that. There's also a few client-specific ones too. For now I added only some short block and would like to hear what you think about it. |
I have nothing against your approach here. I think we just need to add those here with a little description of the methods, and we're good to go. Maybe even add a "(deprecated)" to the count method? |
@denihs I added a short note about |
Hey @radekmie can I merge this to 2.9? |
I think it's good to go now @Grubba27 |
Yeah, it's good to go. |
Just as announced at my Meteor Impact 2022 presentation, I wanted to bring the Meteor's Collections API on par with the native MongoDB driver. It's rather natural and doesn't cause any problems, as the method names mostly don't overlap anymore (e.g.,
insertOne
instead ofinsert
).In this pull request, I add both
countDocuments
andestimatedDocumentCount
. (Yes, bothcollection.count()
andcursor.count()
calls are deprecated.) On the server side, it uses the MongoDB driver directly, without any Meteor magic, and no Fibers whatsoever. On the client side, it's as simple as a call tocountAsync
.NOTE: It's not ready to merge just yet, as it requires some documentation, but the code is there.