Delete user
Deletes user by name
- Parameters
- Advanced call ?
Function DeleteUser(Val Connection, Val Name, Val Base = Undefined, Val Parameters = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Connection | --dbc | String, Arbitrary | ✔ | Connection or connection string |
| Name | --name | String | ✔ | Users name |
| Base | --db | String | ✖ | Database name. Current database if not specified |
| Parameters | --params | Structure Of KeyAndValue | ✖ | Additional deletion parameters |
Returns
Map Of KeyAndValue - Operation result
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Address = "127.0.0.1:1234";
Login = "bayselonarrend";
Password = "12we...";
Base = "main";
ConnectionParams = New Structure("authSource", "admin");
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, , Login, Password, ConnectionParams);
Connection = OPI_MongoDB.CreateConnection(ConnectionString);
UserName = "newuser";
Result = OPI_MongoDB.DeleteUser(Connection, UserName, Base);
- Bash
- CMD/Bat
oint mongodb DeleteUser \
--dbc "mongodb://bayselonarrend:12we3456!2154@127.0.0.1:27017/?authSource=admin" \
--name "newuser" \
--db "main"
oint mongodb DeleteUser ^
--dbc "mongodb://bayselonarrend:12we3456!2154@127.0.0.1:27017/?authSource=admin" ^
--name "newuser" ^
--db "main"
Result
{
"result": true,
"data": {
"ok": 1
}
}