|
This was fixed in 2.6 as part of the rewrite of the query engine:
> db.version()
|
2.6.7
|
> var coll = db.getCollection("geoprojection")
|
> coll.drop()
|
true
|
> coll.insert({_id : 1, loc : {type:"Point", coordinates:[ 5 , 5 ]}, foo : 1})
|
WriteResult({ "nInserted" : 1 })
|
> coll.insert({_id : 2, loc : {type:"Point", coordinates:[ 5 , 5 ]}, foo : 2})
|
WriteResult({ "nInserted" : 1 })
|
> coll.insert({_id : 3, loc : {type:"Point", coordinates:[ 5 , 5 ]}, foo : 3})
|
WriteResult({ "nInserted" : 1 })
|
> coll.ensureIndex({foo: 1, loc : "2dsphere"});
|
{
|
"createdCollectionAutomatically" : false,
|
"numIndexesBefore" : 1,
|
"numIndexesAfter" : 2,
|
"ok" : 1
|
}
|
>
|
> coll.find({foo : {$lt:3}}, {foo:1, loc:1, _id:0}).hint({foo: 1, loc:"2dsphere"});
|
{ "loc" : { "type" : "Point", "coordinates" : [ 5, 5 ] }, "foo" : 1 }
|
{ "loc" : { "type" : "Point", "coordinates" : [ 5, 5 ] }, "foo" : 2 }
|
Closing as a duplicate of SERVER-10026.
|