I want to get the documents from MongoDB that don't have the field "name":"John" (just an example).
How can I do this?
For getting the documents that have the field "name":"John" I use:
db.col.find({"name":"John"})
I've already tried ...find(!{"name":"John"}).
Just use $ne selector like this:
db.col.find({"name":{$ne:"John"}})