I\'m trying to find all documents that do not contain at least one document with a specific field value. For example here is a sample collection:
{ _id : 1
Using $nin will work, but you have the syntax wrong. It should be:
db.collection.find({'docs.foo': {$nin: [1]}})