Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not__match__nin is not working #1034

Open
namtuoc0202 opened this issue Jun 18, 2015 · 3 comments
Open

not__match__nin is not working #1034

namtuoc0202 opened this issue Jun 18, 2015 · 3 comments

Comments

@namtuoc0202
Copy link

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"]}}}})
@MRigal
Copy link
Member

MRigal commented Jun 18, 2015

Hi @namtuoc0202 Thanks for reporting!
We seem indeed to have an issue here. Would you like to submit a Pull Request with a proper failing test? You can of sure also submit a fix, but also simply the test would help us to fix the problem!
Thanks in advance!

@MRigal MRigal modified the milestone: 0.10.1 Jun 23, 2015
@reallistic
Copy link
Contributor

This may be fixed in #1117
I'll double check if I get a chance.

@bagerard
Copy link
Collaborator

for future ref, bug still exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants