node.js - Sails.js : findOne() works but not find() in Waterline -
i developing sails.js app mysql
. have model, create , retrieve work without problems.
model.findone({ where: { someattribute : 'foo' }, function(err, model) { // logic });
works fine, not
model.find({ where: { someattribute : 'foo' }, function(err, model) { // logic });
model.find(...)
returns empty array. have multiple records on model satisfy clause condition.
given code should cause error! not in valid format. should be
model.findone({ where: { someattribute : 'foo' }}).exec(function(err, model) { // logic }); model.find({ where: { someattribute : 'foo' }}).exec(function(err, model) { // logic });
update code clarify question.
Comments
Post a Comment