mongod.log 显示:
{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
该集合有大约 10k 条记录,其中deliver_area
一个字段是 Polygon(GeoJSON) 并具有2dsphere
索引
这是我的查询:
db.area_coll.find( {
id: 59,
deliver_area: {
$geoIntersects: {
$geometry: {
type: "Point",
coordinates: [ 116.3175773620605, 39.97607231140137 ]
}
}
}
})
解释结果:
{
"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"
}