Mongodb C#空间查询

Mongodb C#空间查询,c#,mongodb,geospatial,mongodb-.net-driver,C#,Mongodb,Geospatial,Mongodb .net Driver,我正在Windows 7机器上使用CSharp驱动程序 总之,数据结构: public class Site { [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } public string Name { get; set; } public List<SiteLocation> Locations = new List<SiteLocation>(

我正在Windows 7机器上使用CSharp驱动程序

总之,数据结构:

public class Site
{
    [BsonRepresentation(BsonType.ObjectId)]
    public string Id { get; set; }
    public string Name { get; set; }
    public List<SiteLocation> Locations = new List<SiteLocation>();
}

public class SiteLocation
{
    [BsonRepresentation(BsonType.ObjectId)]
    public string Id { get; set; }
    public List<string> Address { get; set; }
    public GeoJsonPoint<GeoJson2DGeographicCoordinates> Location { get; set; }
}
公共类站点
{
[BsonRepresentation(BsonType.ObjectId)]
公共字符串Id{get;set;}
公共字符串名称{get;set;}
公共列表位置=新列表();
}
公共类站点位置
{
[BsonRepresentation(BsonType.ObjectId)]
公共字符串Id{get;set;}
公共列表地址{get;set;}
公共GeoJsonPoint位置{get;set;}
}
创建索引的代码:

Database.GetCollection<Site>("site")
  .EnsureIndex(IndexKeys<SiteLocation>.GeoSpatialSpherical(x => x.Location));
Database.GetCollection(“站点”)
.EnsureIndex(索引键.地理空间球体(x=>x.Location));
用于查找附近点的查询:

var point = GeoJson.Point(GeoJson.Geographic(153.0, -27.5)); //long, lat
var locationClause = Query<SiteLocation>.Near(p => p.Location, point, 2000);
var query = _ctx.Sites.AsQueryable().Where(x => locationClause.Inject());
var results = query.ToList();
var point=GeoJson.point(GeoJson.Geographic(153.0,-27.5))//长,拉特
var locationClause=Query.Near(p=>p.Location,point,2000);
var query=_ctx.Sites.AsQueryable().Where(x=>locationClause.Inject());
var results=query.ToList();
不幸的是,结果返回的计数为零。而且有一个记录与相同的纬度、经度和其他非常接近

你知道问题出在哪里吗