pymongo - Mongodb find all except from one or two criteria -


alright 1 field matching run:

db.bios.find( { "country":"netherlands" } ) 

how can bring documents not ones "country":"netherlands"?

also possible bring documents without 2 countries?

use $nin operator

for example:

db.bios.find( { country: { $nin: ["country1", "country2"] } } ) 

and $ne 1 country:

db.bios.find( { country: { $ne: "country1" } } ) 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -