Using $gte and $lt on the shard key fields inside a query will cause it the query to be targeted to only the appropriate shards.
However, using the $min and $max query operators (while hinting on the shard key) doesn't target the query to the relevant shard(s) in the same way. The explain() is missing indexBounds in this case, which may be the cause or at least related?
I also tested 2.4.10 and 2.7.2 and the issue is present both.
- is depended on by
-
SPARK-98 MongoShardedPartitioner and hashed shard keys not working correctly
- Closed
- related to
-
SERVER-28667 Provide a way for the Aggregation framework to query against intervals of a hashed index
- Backlog