我有一个正常工作的查询,但我想根据英里而不是坐标平原来制作半径。这是它的样子($ text:search和$ geoWithin:$ center search。
之间的组合let query = {
user_type: type,
$text: {$search: keyword},
'loc': { "$geoWithin": { "$center": [ [longitude, latitude], 1] } }
};
Profile.find(query, {score: {$meta: "textScore"}})
阅读https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center后
好像是the circle’s radius, as measured in the units used by the coordinate system.
我如何传递一英里值并将其转换为半径系统?