__in odd behaviour when given an empty list

76 views
Skip to first unread message

Colin Howe

unread,
Nov 18, 2011, 4:21:02 AM11/18/11
to mongoen...@googlegroups.com
Hi,

I just noticed that if you do:

SomeDoc.objects(field__in=[])

It passes that through as a query parameter and returns no results as expected. However, if you are running in an environment where table scans are forbidden then this raises an exception saying it has caused a table scan. This behaviour is probably a bug in MongoDB itself. However, I was thinking that this case should be handled slightly differently in MongoEngine - by returning no results and not doing a query at all. What do you guys think? (We're hitting this because we pass through lists as arguments and sometimes we validly have empty lists)


Cheers,
Colin

Dan Crosta

unread,
Nov 18, 2011, 10:14:38 AM11/18/11
to mongoen...@googlegroups.com
I think this is a bug in MongoDB. I've created https://jira.mongodb.org/browse/SERVER-4317 to track it. Please vote for it if this is an important issue for you.

- Dan

Colin Howe

unread,
Nov 18, 2011, 10:18:15 AM11/18/11
to mongoen...@googlegroups.com
Awesome - thank you! :)
Reply all
Reply to author
Forward
0 new messages