简体   繁体   中英

MongoDb Spring data GeoNear query with max and min distance

I am trying to implement $near query in spring data mongodb with maxDistance and minDistance . NearQuery has maxDistance but doesn't have minDistance . According to mongodb explanation it support minDistance with maxDistance . I could not find any sample code doing this in spring and could not see that in soring data mongodb api in spring. Furthermore, This doc is also doing what I need and I dont know how to impelement $nearSphere in spring.

 Point point = new Point(longitude, latitude);
 NearQuery nq = NearQuery.near(point).maxDistance(new Distance(2, Metrics.KILOMETERS));

That's not supported yet. I've filed DATAMONGO-1110 for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM