如何使用 C# 运行地理查询
就这么简单:
db.restaurants.find({ location:
{ $geoWithin:
{ $centerSphere: [ [ -73.93414657, 40.82302903 ], 5 / 3963.2 ] } } })
关于如何做到这一点有什么想法吗?
最佳答案
我相处得很好, 方法如下:
var filter = Builders<BsonDocument>.Filter.GeoWithinCenterSphere("location", -73.93414657, 40.82302903 ,5 / 3963.2);
var results = collection.Find(filter).toList();
谢谢
关于c# - 如何在 MongoDB C# 中使用地理空间查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56024058/