Meteor.Collection.ObjectID() vs MongoDB ObjectId()
Using the Meteor method you can use the following:
Meteor.Collection.ObjectID() is the same as MongoDB’s ObjectID, Its just under the Meteor.Collection name. It uses EJSON to hold object id’s in ordinary JSON to the client end. Because basically there are 2 databases with meteor
This is a sort of cache of mongodb on the client end. The data is downloaded from the main mongodb on the server to this one when the browser loads up. When changes are made they are pushed up to the server.
This is the original mongodb from 10gen on the server
So because of these two databases Meteor needs to wrap mongodb functionality in Meteor.Collection and let you use the same code on both the client and server.
By default meteor won’t use Object IDs it’ll use sort of random alphanumeric text. This is done so you can easily use ID’s in your URL’s and ID’s in your html attributes.
If you do use new Meteor.Collection.ObjectID() you will get an ObjectID object that will use mongodb’s specification of ObjectID on the server end. The timestamp value in the Object ID isn’t held up but this shouldn’t really do any harm.