【发布时间】:2016-05-05 07:48:57
【问题描述】:
我有一种情况,我必须找到 3 公里内所有最近的酒店,并显示它们的距离和给定位置的预计时间。
我的代码用于获取 3 公里附近所有最近的酒店。
Hotels.geoNear({
type: "Point",
coordinates: [userLat, userLng]
}, {
spherical: true,
maxDistance: 3000,
distanceMultiplier: 0.001
}).then(function(hotels) {
console.log(hotels);
});
在这里我可以获取所有对象的距离,但我不知道如何获取每个位置的估计时间。
有什么建议可以找到每个位置的预计时间吗?
【问题讨论】:
标签: mongodb mongodb-query