是否可以在mongodb中的点列表中进行基于位置的查询?
目前我这样做:
@Document
public class Restaurant {
@Id
private ObjectId id;
// store locations of restaurant branches
private List<Point> locationPoints = new ArrayList<>();
}
餐厅将有多个地点,我需要找到一个特定点附近的餐馆。
Point londonPoint = new Point(-0.125487, 51.508515); // london
List<Restaurant> restaurants = restaurantService.findBylocationPointsNear(londonPoint, new Distance(30, Metrics.KILOMETERS));