Open
Description
I have DB like this
{ "_id" : ObjectId("558233a3f89235c3ef7e2985"), "list" : [ "1", "2", "3", "4", "5" ] }
{ "_id" : ObjectId("558233abf89235c3ef7e2986"), "list" : [ "6", "2", "3", "4", "5" ] }
and raw query is:
> db.chara.find({list: {$not: {$elemMatch: {$nin: ["2", "3", "4", "5", "6", "7"]}}}})
{ "_id" : ObjectId("558233abf89235c3ef7e2986"), "list" : [ "6", "2", "3", "4", "5" ] }
But when I use this query, it may be ignore and all record be showed
chara.objects.filter(list__not__match__nin=["2", "3", "4", "5", "6", "7"])
However, this work perfectly:
chara.objects.filter(__raw__={"compare_targets": {"$not": {"$elemMatch": {"$nin": ["2", "3", "4", "5", "6", "7"]}}}})