2d index:
使用2d index 能够将数据作为2维平面上的点存储起来,在MongoDB 2.2以前推荐使用2d index索引。...地理位置索引-2d索引 $geoWithin 查询矩形中的点
db.location.find({w:{$geoWithin:{$box:[[0,0],[3,3]]}}})
db.location.find...({w:{$geoWithin:{$box:[[1,1],[2,3]]}}})
地理位置索引-2d索引 $geoWithin 查询圆形中的点
db.location.find({w:{$geoWithin...],[0,1],[2,5],[6,1]]}}})
geoNear
地理位置索引-2d索引 geoNear
geoNear查询使用runCommand命令进行使用,db.runCommand({geoNear...:,near:[,],minDistance:(对2D索引无效,2Dsphere有效),maxDistance:(最大距离),num:(返回结果个数)})
db.runCommand({geoNear: