|
This reporting issue was fixed as part of the query engine rewrite for 2.6:
> db.version()
|
2.6.7
|
> var coll = db.getCollection("covered_geo_2")
|
> coll.drop()
|
true
|
>
|
> coll.insert({_id : 1, loc1 : [ 5 , 5 ], type1 : "type1", loc2 : [ 5 , 5 ], type2 : 1})
|
WriteResult({ "nInserted" : 1 })
|
> coll.insert({_id : 2, loc1 : [ 6 , 6 ], type1 : "type2", loc2 : [ 5 , 5 ], type2 : 2})
|
WriteResult({ "nInserted" : 1 })
|
> coll.insert({_id : 3, loc1 : [ 7 , 7 ], type1 : "type3", loc2 : [ 5 , 5 ], type2 : 3})
|
WriteResult({ "nInserted" : 1 })
|
>
|
> coll.ensureIndex({loc1 : "2dsphere", type1 : 1});
|
{
|
"createdCollectionAutomatically" : false,
|
"numIndexesBefore" : 1,
|
"numIndexesAfter" : 2,
|
"ok" : 1
|
}
|
> coll.ensureIndex({type2: 1, loc2 : "2dsphere"});
|
{
|
"createdCollectionAutomatically" : false,
|
"numIndexesBefore" : 2,
|
"numIndexesAfter" : 3,
|
"ok" : 1
|
}
|
> coll.find({type2 : {$lt:3}}, {type2:1, loc2:1, _id:0}).hint({type2: 1, loc2:"2dsphere"}).explain();
|
{
|
"cursor" : "BtreeCursor type2_1_loc2_2dsphere",
|
"isMultiKey" : false,
|
"n" : 2,
|
"nscannedObjects" : 3,
|
"nscanned" : 3,
|
"nscannedObjectsAllPlans" : 3,
|
"nscannedAllPlans" : 3,
|
"scanAndOrder" : false,
|
"indexOnly" : false,
|
"nYields" : 0,
|
"nChunkSkips" : 0,
|
"millis" : 0,
|
"indexBounds" : {
|
"type2" : [
|
[
|
{
|
"$minElement" : 1
|
},
|
{
|
"$maxElement" : 1
|
}
|
]
|
],
|
"loc2" : [
|
[
|
{
|
"$minElement" : 1
|
},
|
{
|
"$maxElement" : 1
|
}
|
]
|
]
|
},
|
"server" : "dstorch-desktop:27017",
|
"filterSet" : false
|
}
|
Note that the reporting is different in 3.0.x versions due to changes to explain made under SERVER-10448. Closing as a duplicate.
|