mongod.log shows:
{deliver_area: { $geoIntersects:
{ $geometry: {
type: "Point",
coordinates: [ 116.3426399230957, 39.95959281921387 ]
} }
} }
ntoreturn:0
ntoskip:0
nscanned:2965
keyUpdates:0
numYields: 2 locks(micros)
r:136723
nreturned:52
reslen:23453
103ms
The collection has about 10k records, where deliver_area
is one of the fields which is a Polygon(GeoJSON) and has a 2dsphere
index
This is my query:
db.area_coll.find( {
id: 59,
deliver_area: {
$geoIntersects: {
$geometry: {
type: "Point",
coordinates: [ 116.3175773620605, 39.97607231140137 ]
}
}
}
})
Explain result:
{
"cursor" : "S2Cursor",
"isMultiKey" : true,
"n" : 0,
"nscannedObjects" : 0,
"nscanned" : 3887,
"nscannedObjectsAllPlans" : 0,
"nscannedAllPlans" : 3887,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 5,
"indexBounds" : {
},
"nscanned" : 3887,
"matchTested" : NumberLong(666),
"geoTested" : NumberLong(0),
"cellsInCover" : NumberLong(1),
"server" : "testing:27017"
}