【发布时间】:2016-12-14 01:20:59
【问题描述】:
我升级了 MongoDB-C# 驱动程序,但找不到有关如何创建 GeoSpatial 索引的信息。我看过很多使用collection.EnsureIndex 的帖子,但我没有那个。
我曾经使用以下内容,其中'collection'是IMongoCollection<>:
collection.CreateIndex((new IndexKeysBuilder().GeoSpatialSpherical("Location")));
有什么新方法可以做到这一点?
【问题讨论】:
标签: c# mongodb indexing geospatial mongodb-.net-driver