$nin
Last updated
What is $nin?
The $nin (not in) operator in MongoDB selects documents where a field value does not match any value in a specified array. It's the logical opposite of $in and excludes documents with field values present in the given array. $nin is useful for filtering out unwanted values, excluding specific categories, and creating blacklist-style queries.
Free resources to learn $nin
- Official docs$nin
- Official docsAggregation Operators
More in stage 5: Creating Indexes
$nin: common questions
Can I learn $nin in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain $nin in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this $nin tutorial for beginners?
It is lesson 47 of 106 in the free MongoDB roadmap, in stage 5, Creating Indexes. If you are new to MongoDB, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.