How do I do a “NOT IN” query in Mongo?

You can use $in or $nin for “not in”

Example …

> db.people.find({ crowd : { $nin: ["cool"] }});

I put a bunch more examples here: http://learnmongo.com/posts/being-part-of-the-in-crowd/

Leave a Comment