collection.insert

Mongo documentation

Inserts a single document or a an array of documents into MongoDB.

Arguments

  1. docs (Object|Array)

  2. [options] (Object)

Use castIds: false to disable autocasting of '_id' properties to ObjectIds objects.

  1. [callback] (function)

Returns

A promise.

Example

users.insert({ woot: 'foo' })
users.insert([{ woot: 'bar' }, { woot: 'baz' }])

results matching ""

    No results matching ""