ElectronicBlacksmith
ElectronicBlacksmith

Reputation: 420

Meteor.Collection.ObjectID() returning 'undefined'

I have a running Meteor application on a Fedora 18 workstation. The meteor web application appears to be functioning correctly without errors in the web console. When I try to run the following in the Web console it returns undefined.

Meteor.Collection.ObjectID()

According to the documentation and other StackOverflow answers this should work. I have used both FireFox and Chrome to test this. What am I missing?

Upvotes: 2

Views: 1285

Answers (3)

Isaac Han
Isaac Han

Reputation: 368

Mongo replaced Meteor.Collection. Mongo.ObjectID follows the same API as the Node MongoDB driver ObjectID class.

var _id = new Mongo.ObjectID();

http://docs.meteor.com/#/full/mongo_object_id

Upvotes: 0

Brian Bolton
Brian Bolton

Reputation: 3642

Try without the parentheses.

Meteor.Collection.ObjectID

Upvotes: 0

sohel khalifa
sohel khalifa

Reputation: 5578

Did you tried to create this ObjectID() with new ?

Please try :

var _id = new Meteor.Collection.ObjectID();
console.log(_id);

Upvotes: 1

Related Questions