首页 > 其他 > 详细

longitude

时间:2016-09-19 10:11:03      阅读:124      评论:0      收藏:0      [点我收藏+]

确保有loc:[longitude, latitude]属性
给loc增加索引AttractionSchema.index({loc: ‘2d‘});
使用geoNear
db.places.find(
{
location: {
$nearSphere: {
$geometry: {
type : "Point",
coordinates : [ -73.9667, 40.78 ]
},
$minDistance: 1000,
$maxDistance: 5000,

}
}
}
)


spherical: true

longitude

原文:http://www.cnblogs.com/jayruan/p/5883922.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!