-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.3
-
Component/s: Querying
-
None
-
ALL
The following query runs successfully on 2.6.3, but explains doesn't allow $min / $max.
> db.bar.ensureIndex({ a: 1}) { "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > db.bar.insert({a: 100}) WriteResult({ "nInserted" : 1 }) > db.bar.find({ $min: { a: 1}, $query: {} }) { "_id" : ObjectId("53c553de010c89b3b2c76040"), "a" : 100 } > db.bar.find({ $max: { a: 1}, $query: {} }).explain() 2014-07-15T12:09:53.686-0400 error: { "$err" : "Can't canonicalize query: BadValue unknown top level operator: $max", "code" : 17287 } at src/mongo/shell/query.js:131
- duplicates
-
SERVER-6767 Interpret $query as special so you can copy profiler/logged queries into shell
- Closed