public void TestGeoSpatialRange() { var options = IndexOptions.SetGeoSpatialRange(1.1, 2.2); string expected = "{ \"min\" : 1.1, \"max\" : 2.2 }"; Assert.AreEqual(expected, options.ToJson()); }
public void TestGeoSpatialRange() { var options = IndexOptions <TestClass> .SetGeoSpatialRange(1.5, 2.5); string expected = "{ \"min\" : 1.5, \"max\" : 2.5 }"; Assert.Equal(expected, options.ToJson()); }
static MongoCollections() { var db = MongoManager.getDB(); var store = db.GetCollection <StoreMgDTO>(MongoKeyConst.CollectionName); var geoindexMapLocation = IndexKeys <StoreMgDTO> .GeoSpatial(c => c.Location); store.EnsureIndex(geoindexMapLocation, IndexOptions.SetGeoSpatialRange(0, 300)); }