The limit for the recursive tree depth of query documents currently is only 10 levels deep. While most queries should not be affected by this issue, certain auto-generated queries, for example from ORM mappers, can construct complex nested query documents and hit the limit.
In 2.4 the limit was not strictly enforced, so users may find some of their queries to be rejected after upgrading to 2.6.
Manual queries with a high tree depth often can be reduced to a flatter version, for example by removing nested $and predicates and instead adding the conditions to a single $and statement.
This patch increases the tree depth from 10 to 100 and brings it in line with the value documented on the MongoDB Limits and Thresholds page.
MongoDB 2.6.0 is affected by this bug.
The patch is included in the 2.6.1 production release.