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
Post a Comment