mongoose-create-or-update (master) doxdox documentation

A Promise-based Mongoose plugin for creating and updating documents in a single statement.

# scheme.statics.createOrUpdate(query, update, options)

Creates or updates an existing document in a Mongoose model.

Parameters

Name Types Description
query Object Query object.
update Object Updated object. See http://mongoosejs.com/docs/api.html#model_Model.update for more information.
options Object Options object. See http://mongoosejs.com/docs/api.html#model_Model.update for more information.

Returns

Object

Promise