Reputation: 9
How to perform a query (.find) in MongoDB indicating that I do NOT want a word to appear in one of the document fields.
Thanks
I dont know the excatly command
Upvotes: 0
Views: 379
Reputation: 20304
You can do it with $not
and $regex
operators:
db.collection.find({
"field": {
"$not": {
"$regex": "some"
}
}
})
Upvotes: 1