我需要在java中“翻译”这个shell查询(MongoDB):
db.runCommand( { geoNear: 'test', near: {type: "Point", coordinates: [115.0. 12.0]}, spherical: true, maxDistance: 40000})
我使用 mongo-java-driver:3.1.0,我用 shell 测试了这个查询并且工作正常。
文档:
{id:“测试”,“几何”:{“类型”:“点”,“坐标”:[115.2,12.2]}}