-1
如何在从AngularJS调用SailsJS api时通过not equal to
的where
子句。如何在角度js中使用不等于js的where子句
如何在从AngularJS调用SailsJS api时通过not equal to
的where
子句。如何在角度js中使用不等于js的where子句
在sailsjs中,根据sails.js query language docs,可以在查询特定模型时使用感叹号来努力not equals to
。例如,考虑sailsjs模型Person
:
Person.find({
name: { '!': 'Lenilson de Castro' }
}).exec(function (err, personsNotNamedFoo){
// $scope.personsNotNamedFoo = personsNotNamedFoo;
// or myCallBack(personsNotNamedFoo);
// or even deferred.resolve(personsNotNamedFoo);
});
它主要是指:
find all persons in `Person` where `person.name` not equals to 'Lenilson de Castro'
类似的情景在那里aditional的查询选项可能是必要的。
Person.find({
where: { name: { '!': 'foo' }},
limit: 10,
skip: 10
}).exec(....
您好!您能否提供一个可测试的场景,让您将angularjs和sailsjs放在一起,展示您迄今的努力。 –