Mindw0rk
Mindw0rk

Reputation: 91

Not in array in sails's waterline ORM

How to execute "not in array" query in Sails' waterline ORM that would be equal to mongooses' $nin?

Question.find({id: {"!=": [2] } }).exec(function(err, docs){}) 

this example seems not working.

Upvotes: 3

Views: 1802

Answers (2)

particlebanana
particlebanana

Reputation: 2416

You can do the following query in Sails-Mongo

Model.find({ id: { '!': [2,3,4,...] } }

Upvotes: 2

bredikhin
bredikhin

Reputation: 9025

Seems like $nin, which should have been implemented on the adapter level, simply hasn't been added to sails-mongo yet. At least, there's no sign of it in the current source code.

Upvotes: 0

Related Questions