I took this example:
db.inventory.update( { tags: { $nin: [ "appliances", "school" ] } }, { $set: { sale: false } } )
form the mongodb.org website.
Whenever I try to use $nin multiple times, find_and_modify fails. Whan I want to achieve:
db.inventory.update( { tags: { $nin: [ "appliances", "school" ]}, owners: {$nin : ["a","b"] }, { $set: { sale: false } } )
But it seems like I am not allowed to use $nin mutiple times. I know $push can't be used like that, so I just use $push on multiple fields once. But how can use it for the $nin?