meteor-find-and-modify
meteor-find-and-modify copied to clipboard
Support Mongo.ObjectID
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.
+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.
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.