Possible to get different results between 2.5.5-pre and 2.4 using $not and $lte operators. Seems likely to me this works with $gt, $gte, and $lte
2.4.9:
> mydb.r.insert({_id: 0})
> mydb.r.find({_id: {$not: {$lte: ISODate("9999-12-31")}}})
> mydb.r.find({_id: {$gt: ISODate("9999-12-31")}})
2.5.5-pre:
> db.r.insert({_id: 0})
SingleWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 1,
"nUpserted" : 0,
"nUpdated" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
> db.r.find({_id: {$not: {$lte: ISODate("9999-12-31")}}})
{ "_id" : 0 }
> db.r.find({_id: {$gt: ISODate("9999-12-31")}})
- duplicates
-
SERVER-12495 Queries with {$not: {$lt: 0}} are not the same as {$gte: 0}
-
- Closed
-