Waterline ORM (sails.js) conditions with NOT Equal in query
问题 How can I write a NOT Equal condition in Waterline? This code: Users .count() .where({ id: { '!=': req.params.id}, lastname: req.body.lastname }) Does nothing... (disk adapter in sails.js) 回答1: First thing, it do nothing because looking into database is asynchronous. You have to make the chain longer and add exec or something from Q library like then. User.count().where({ id: { '!=': req.params.id }, lastname: req.body.lastname }).exec(function(err, num){ console.log(num); }); Now it returns