private MongoCollection GetCollection(string collectionName)
{
MongoCollection collection = null;
if (!this._collections.TryGetValue(collectionName, out collection))
{
if (!this._database.CollectionExists(collectionName))
{
this._database.CreateCollection(collectionName, null);
}
collection = this._database.GetCollection(collectionName);
this._collections.Add(collectionName, collection);
collection.EnsureIndex(
IndexKeys.GeoSpatial("coord"),
IndexOptions.SetGeoSpatialRange(-_indexRange, _indexRange));
}
return collection;
}