在NodeJS的两个位置之间获取logging

如何通过mongoose获取NodeJS中两个位置的logging。 我正在使用函数来查找具有function的logging,

getAllEvent: function (locationReq, callback) { Events.find({ location: { $near: { $geometry: { loc: locationReq }, $maxDistance: 0, $minDistance: 250 } } }, {isDeleted: false}, function (error, data) { callback((error) ? {} : (data == null) ? {} : data); }); }, 

这个函数返回空值。

特定logging的位置也存储在数据库文档的集合中。 在LocationReq中将发送两个位置值。 如果logging在两个位置之间,我想要logging。

数据库文件如下,

 { "_id" : ObjectId("59db3a1e56e60915086fb73f"), "eventName" : "5643213246", "createdId" : "599d698ffa23343efe9c5cbb", "eventDateTime" : ISODate("2017-08-09T00:00:00.000Z"), "startTime" : ISODate("2017-08-16T13:01:52.379Z"), "endTime" : ISODate("2017-08-16T13:01:52.379Z"), "location" : { "lat" : "59.9500", "lng" : "30.3300" }, "description" : "description123", "category" : "59db12dab928f105a87348f6", "host" : "host", "phoneNumber" : 123123, "isDisabled" : false, "isDeleted" : true, "dateCreated" : ISODate("2017-10-09T08:58:06.687Z"), "__v" : 0, "updatedAt" : ISODate("2017-10-24T06:47:07.966Z") } 

 getAllEvent: function (locationReq, callback) { Events.find({ loc: { $nearSphere: { $geometry: {type: "Point", coordinates: [lng, lat]}, $maxDistance:distance } }, {isDeleted: false}, function (error, data) { callback((error) ? {} : (data == null) ? {} : data); }); }, 

并将位置参数replace为loc