Skip to main content

Delete user

Deletes user by name

Function DeleteUser(Val Connection, Val Name, Val Base = Undefined, Val Parameters = Undefined) Export

ParameterCLI optionTypeRequiredDescription
Connection--dbcString, ArbitraryConnection or connection string
Name--nameStringUsers name
Base--dbStringDatabase name. Current database if not specified
Parameters--paramsStructure Of KeyAndValueAdditional deletion parameters
Returns

Map Of KeyAndValue - Operation result

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);
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
}
}