I’m using multiple operators in this query. I get no syntax errors, but I’m not getting any data back (and should be), so I’m pretty certain that I’m looking at a logical error. Problem is, I don’t see it.
Query:
db.questions.find(
{'$and': [
{'answers.s_user_id': {'$ne': s_user_id}},
{'$or': [
{'s_text': re.compile(s_term, re.IGNORECASE)},
{'choices': re.compile(s_term, re.IGNORECASE)}
]}
]}
)
Any tips are appreciated.
I just found the issue as documented here: https://jira.mongodb.org/browse/SERVER-2585
Nested $OR is not supported until MongoDB 1.9.1 as of 7-24-2011. I’m on an older version.