ISSUE SUMMARY
A query with a non-top-level $not or $ne operator using an index triggers a bug in the query planning system and fails with an assertion error.
Example:
db.coll.find( {'$or': [ {'state': 1, 'is_draft': 1}, {'published_date': {'$ne': 1} } ] } )
This query has a negation underneath an $or parent node. If each of the fields is indexed, this query would trigger the bug.
USER IMPACT
Queries matching the above condition fail with an assertion.
WORKAROUNDS
Rewrite the query to avoid non-top-level negation on indexed fields if possible.
AFFECTED VERSIONS
Versions 2.6.0 and 2.6.1 are affected by this issue.
FIX VERSION
The fix is included in the 2.6.2 production release.
RESOLUTION DETAILS
A bug in creating the memoized data structure used to enumerate the space of query plans is now fixed.
Original description
A query that used to work on 2.2 is now failing when upgrading to 2.6.