Waterline.removeFromCollection()

Remove the specified IDs from the associated collection of this record.

Usage

Hover over inputs/exits for more info.

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


// Remove the specified IDs from the associated collection of this record.

Waterline.removeFromCollection({

model: 'user',

recordId: '*',

association: 'locations',

associatedIdsToRemove: [ '*' ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The primary record (i.e. with the specified `recordId`) could not be found.

recordNotFound: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

model required

'user'
recordId required

The ID of this record.

'*'
association required

The name of the association.

'locations'
associatedIdsToRemove required

The IDs to remove from this record's associated collection.

[ '*' ]

Exits

error

An unexpected error occurred.

recordNotFound

The primary record (i.e. with the specified `recordId`) could not be found.

success

OK.