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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -