Is it possible to run
db.Users.createIndex({"FirstName" : 1, "LastName": 1});
from RunCommandAsync there are also examples of what can be done from the team.
As a test, I tried to run this, but through an exception
var indexCommand = new BsonDocumentCommand<BsonDocument>(new BsonDocument{
{"getIndexes", "Users"}
});
var results = await database.RunCommandAsync(indexCommand);
I know that I can receive and create indexes from C # drivers, however, I would like to synchronize the script between those who want to create indexes through C # and those who want to process it directly in the database.
source
share