Meteor can't find by id in a Mongo.Collection Meteor can't find by id in a Mongo.Collection mongodb mongodb

Meteor can't find by id in a Mongo.Collection


Shortly after typing this out I stumbled on an old StackOverflow issue that pointed to a Meteor issue that was closed in 2013 that records created in the meteor mongo console treat strings and Mongo.ObjectIds differently.

So I tried Articles.findOne(new Mongo.ObjectID("572bdb811ab1829622aeee78")) instead of Articles.findOne("572bdb811ab1829622aeee78") and it worked:

casting the id as a Mongo.ObjectID works

So... what the heck. None of the example code shows the need to cast ids to a Mongo.ObjectID, and the issue that brought this up originally was closed three years ago.