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

Support Mongo.ObjectID #12

Open
fongandrew opened this issue Nov 2, 2015 · 2 comments
Open

Support Mongo.ObjectID #12

fongandrew opened this issue Nov 2, 2015 · 2 comments

Comments

@fongandrew
Copy link
Owner

Meteor supports using Mongo's internal ObjectID in lieu of a string when the right idGeneration option is passed (http://docs.meteor.com/#/full/mongo_collection). We should build in some support for that option into findAndModify.

@obezuk
Copy link

obezuk commented Aug 30, 2016

+1 for this issue.

I've tried to resolve myself but do not have a good enough understanding on how to query Mongo.ObjectIDs within the underlying Mongo connection. Using Mongo.ObjectID within the query does not provide any results.

If you can assist by providing an example of how to query based on a Mongo.Object ID within Meteor I'll happily test and create the pull request.

@fongandrew
Copy link
Owner Author

I'm not sure, but I think you can just do something like {_id: new Mongo.ObjectID("<yourHexString>")} to insert and query? See http://docs.meteor.com/api/collections.html#Mongo-ObjectID.

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

2 participants