Available in VPC
Add a DB user to a Cloud DB for MongoDB instance.
Syntax
The addCloudMongoDbUserList syntax is as follows:
./ncloud vmongodb addCloudMongoDbUserList \
--cloudMongoDbInstanceNo <instance-no> \
--cloudMongoDbUserList <user-config> \
[--regionCode <KR|SGN|JPN>] \
[--output <json|xml>]
Options
This section describes the options available when running addCloudMongoDbUserList.
Required options
The following options are required for addCloudMongoDbUserList.
| Options | Type | Required | Description |
|---|---|---|---|
--cloudMongoDbInstanceNo |
String | Required | Instance number of Cloud DB for MongoDB |
--cloudMongoDbUserList |
List | Required | List of DB users to add
|
Common options
For information about the options common to all vmongodb subcommands, see Cloud DB for MongoDB (VPC) options.
Examples
If the request to add a DB user is successful, the specified user will be added to the Cloud DB for MongoDB instance.
Command
The command example is as follows:
./ncloud vmongodb addCloudMongoDbUserList \
--cloudMongoDbInstanceNo 34567890 \
--cloudMongoDbUserList "userName='testuser1', password='Examplepw123!', databaseName='testdb1', authority='READ'" "userName='testuser2', password='Examplepw123!', databaseName='testdb2', authority='READ_WRITE'" \
--regionCode KR \
--output json
Output
The output example is as follows:
{
"addCloudMongoDbUserListResponse": {
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"returnCode": "0",
"returnMessage": "success"
}
}