Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
ALL
Description
If a collection has, say, 10 chunks and you do db.chunks.find({"min.shardKey":MinKey}), then all 10 chunks will be returned. Same with $maxKey. Seems unintuitive for +/-infinity to match everything.
(Hilarious query for $minKey, recorded for posterity![]()
> // $minKey
|
> db.chunks.find({$and : [{"min._id" : {$not : {$type : 1}}}, {"min._id" : {$not : {$type : 2}}}, {"min._id" : {$not : {$type : 3}}}, {"min._id" : {$not : {$type : 4}}}, {"min._id" : {$not : {$type : 5}}}, {"min._id" : {$not : {$type : 6}}}, {"min._id" : {$not : {$type : 7}}}, {"min._id" : {$not : {$type : 8}}}, {"min._id" : {$not : {$type : 9}}}, {"min._id" : {$not : {$type : 10}}}, {"min._id" : {$not : {$type : 11}}}, {"min._id" : {$not : {$type : 12}}}, {"min._id" : {$not : {$type : 13}}}, {"min._id" : {$not : {$type : 14}}}, {"min._id" : {$not : {$type : 15}}}, {"min._id" : {$not : {$type : 16}}}, {"min._id" : {$not : {$type : 17}}}, {"min._id" : {$not : {$type : 18}}}, {"min._id" : {$not : {$type : 127}}}]})
|
> // $maxKey
|
> db.chunks.find({"min._id":{$type:127}})
|
Attachments
Issue Links
- is related to
-
SERVER-7388 Implement all query operators using MatchExpression
-
- Closed
-