For more information, see http://sailsjs.com/documentation/reference/configuration/sails-config-blueprints (or https://github.com/balderdashy/sails-docs/tree/1.0/reference/sails.config/sails.config.blueprints.md)
{
// The model identity, REQUIRED.
using: 'user',
// Search criteria, used by `find`, `findOne`, `destroy`, `populate` and `update`.
// Note that for all except `find`, the `where` clause must include only the model's primary key.
criteria: {
where: {
age: 25
},
// Skip, limit and sort will be ignored by all blueprints except `find`.
skip: 5,
limit: 10,
sort: [{score: 'desc'}]
},
// Dictionary of associations to populate. Each key should be an attribute name,
// with the value set to a criteria object like the one above.
populates: {
pets: {
where: {
breed: 'cat'
},
sort: [{name: 'asc'}],
limit: 5
}
},
// Values for a new record, valid only for the `create` blueprint.
newRecord: {
name: 'bob',
age: 30,
score: 10,
pets: [3, 65]
},
// Values for an updated record, valid only for the `update` blueprint.
valuesToSet: {
name: 'joe',
age: 12,
},
// Name of a plural association attribute to modify.
// Valid for `add`, `remove`, `replace` and `populate`.
alias: 'pets',
// The primary key of the record containing a plural association to modify.
// Valid for `add`, `remove`, and `replace`.
targetRecordId: 123,
// The primary keys of associated records, for use in `add`, `remove` and `replace`.
// For `add` and `remove` this array must contain only one value.
associatedIds: [34, 12]
}