Adding coordinate to Location model
All checks were successful
All checks were successful
This commit is contained in:
parent
86fa27c78d
commit
fc647890a6
@ -59,16 +59,16 @@ public class LocationStore
|
||||
}
|
||||
};
|
||||
|
||||
var options = new CreateCollectionOptions
|
||||
{
|
||||
Validator = new BsonDocumentFilterDefinition<BsonDocument>(validator),
|
||||
ValidationAction = DocumentValidationAction.Error
|
||||
};
|
||||
|
||||
var collections = db.ListCollectionNames().ToList();
|
||||
if (!collections.Contains(collectionName))
|
||||
{
|
||||
db.CreateCollection(collectionName, options);
|
||||
var createCommand = new BsonDocument
|
||||
{
|
||||
{ "create", collectionName },
|
||||
{ "validator", validator },
|
||||
{ "validationAction", "error" }
|
||||
};
|
||||
db.RunCommand<BsonDocument>(createCommand);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user