javascript - Is Model.update a promise in Sails.js? -
i'm working on sails.js app, , in model function, need execute queries in order. i'm using default promises in waterline, it's not working following code:
model.find().where({id: 1}).then(function(value){ return model.update({id: value[0].id}, {/**some value assignment here*/}); }).then(function(morevalues){ //here 'morevalues' empty array //more code here });
the update
function of models returns promise? if does, doing wrong?
thank you!