collection.insert

Anywhere

collection.insert(doc, [callback])

Insert a document in the collection. Returns its unique _id.

Arguments

doc Object

The document to insert. May not yet have an _id attribute, in which case Meteor will generate one for you.

callback Function

Optional. If present, called with an error object as the first argument and, if no error, the _id as the second.

doc_Meteor
2016-05-29 17:18:08
Comments
Leave a Comment

Please login to continue.