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/
Related Contents:
- Possibility of duplicate Mongo ObjectId’s being generated in two different collections?
- How to remove a field completely from a MongoDB document?
- Store images in a MongoDB database
- MongoDB vs. Cassandra [closed]
- Find duplicate records in MongoDB
- Best practice to maintain a mgo session
- How do you rename a MongoDB database?
- Where does mongodb stand in the CAP theorem?
- How to stop insertion of Duplicate documents in a mongodb collection
- Random record from MongoDB
- How to select a single field for all documents in a MongoDB collection?
- mongodb group values by multiple fields
- What’s Mongoose error Cast to ObjectId failed for value XXX at path “_id”?
- Mongodb $push in nested array
- Cascade style delete in Mongoose
- Multiple join conditions using the $lookup operator
- Add new field to every document in a MongoDB collection
- How to execute mongo commands through shell scripts?
- How to replace substring in mongodb document
- What is the default database path for MongoDB?
- mongo – couldn’t connect to server 127.0.0.1:27017
- return query based on date
- Querying an array of arrays in MongoDB
- MongoDB query with an ‘or’ condition
- How to remove an element from a doubly-nested array in a MongoDB document.
- Is there any option to limit mongodb memory usage?
- Mongo complex sorting?
- Unhandled promise rejection: Error: URL malformed, cannot be parsed
- How to query MongoDB to test if an item exists?
- Difference between count() and find().count() in MongoDB
- Rounding to 2 decimal places using MongoDB aggregation framework
- What does it mean to fit “working set” into RAM for MongoDB?
- How to enable authentication on MongoDB through Docker?
- Is shortening MongoDB property names worthwhile?
- Mongodb aggregation lookup with conditions
- How do I start Mongo DB from Windows?
- NoSQL (MongoDB) vs Lucene (or Solr) as your database [closed]
- MongoDB: output ‘id’ instead of ‘_id’
- MongoDB select count(distinct x) on an indexed column – count unique results for large data sets
- How does sorting with an index work in MongoDB?
- How to return just the nested documents of an array from all documents
- $skip and $limit in aggregation framework
- MongoDB nested array query
- Batch insert/update using Mongoid?
- MongoDB – is DBREF necessary?
- MongoDB $or query
- How can I sort into that nulls are last ordered in mongodb?
- Performing case-statement in mongodb aggregation framework
- saving picture to mongodb
- $unwind an object in aggregation framework