Waterline.update()

Find records from this model that match the specified criteria, and update them with the specified attributes.

Usage

Hover over inputs/exits for more info.

var Waterline = require('machinepack-waterline');


// Find records from this model that match the specified criteria, and update them with the specified attributes.

Waterline.update({

model: 'user',

select: [ 'foo' ],

where: {},

attributes: '*',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

: function () {

 

},

// The provided `where` was invalid.

invalidCriteria: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

model required

'user'
select

[ 'foo' ]
where

{}
attributes

The attributes that the new record should have.

'*'

Exits

error

An unexpected error occurred.

undefined
invalidCriteria

The provided `where` was invalid.

success

OK.

123