For dem, der er interesseret i at oprette en bruger med C# v2.0.1-driveren og MongoDB v3.0.6, brug følgende:
var client = new MongoClient(connectionString);
var database = client.GetDatabase("database_to_create_user_in");
var user = new BsonDocument { { "createUser", "fred" }, { "pwd", "some_secure_password" }, { "roles", new BsonArray { new BsonDocument { { "role", "read" }, { "db", "database_to_create_user_in" } } } } };
await database.RunCommandAsync<BsonDocument>(user);