MongoDB / Mongoose:使用geoJSON与geoNear方法获取不正确的距离

我已经定义了我的模式

var locationSchema = new mongoose.Schema({ coords: { type: [Number], index: '2dsphere' }, }); 

geoJSON对象定义为

 var geoOptions = { spherical: true, maxDistance: 5000, distanceMultiplier : 0.001, num: 10 } loc.geoNear(point, geoOptions, function(error, results, stats){//do stuff}); 

其中loc是我的模型实例,我的观点是

 var point = { type: "Point", coordinates: [lng,lat] }; 

我的数据库中有两个文件,包括coords

 "coords" : [ 18.9164127, 72.8245292 ] "coords" : [ 18.935197, 72.8249342 ] 

我将这两个距离设置为0.619公里,应该超过2公里。 不知道我在做什么错误。 任何帮助,将不胜感激。 提前致谢

这似乎是好的,你插入的格式[经度,纬度]的坐标? 该命令很重要,也是mongo使用geoNear执行查询的顺序。