假设在 mongodb 中有多个带有地理坐标的文档
- {"_id" : .., "userID" : "1", "point: {"type" : "Point", "coordinates" : [ 8.8502715, 45.6114064 ]}}
- {"_id" : .., "userID" : "1", "point: {"type" : "Point", "coordinates" : [ 8.8402715, 45.6214064 ]}}
- {"_id" : .., "userID" : "2", "point: {"type" : "Point", "coordinates" : [ 8.8512715, 45.6124064 ]}} {"_id" : .., "userID" :“3”,“点:{“类型”:“点”,“坐标”:[8.8512715,45.6124064]}}
我想每 5 分钟运行一次测试,并让所有彼此相距 20 米的用户(因此应该忽略相同用户 ID 的点。它只会检查具有不同用户 ID 的文档之间的 maxDistance )。我可以运行任何查询来提供所有积分吗?如果没有,我是否应该检查不同的数据库来存储我将能够运行此类查询的点?
提前致谢?