-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.1
-
Component/s: Querying
-
None
-
ALL
-
Upgrading from 2.4.10 to 2.6.1 (running on OS X 10.9.2) found running an $or query with a nested $lte on indexed fields causes incorrect query results.
db.number_user_id.find({ $or: [{ number: null }, { number: { $lte: 2 } }] }); // On 2.4 you get all 3 documents back on 2.6 you get 1 document back
I posted this on Stack Overflow (http://stackoverflow.com/questions/23805916/mongodb-indexed-queries-returning-incorrect-values-since-upgrading-to-2-6-from-2) and got a couple of answers back suggesting it was a bug, with one saying it works with a sparse index.
- duplicates
-
SERVER-13960 Queries containing $or may miss results if multiple clauses use the same index
- Closed