mongocli config rename
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoCLI.
The config rename
command renames a profile so you don't have to
directly edit the MongoDB CLI Configuration File.
Tip
See also:
Syntax
mongocli config rename <existing-profile-name> <new-profile-name>
Arguments
Argument | Type | Description | Required? |
---|---|---|---|
<existing-profile-name> | string | Name of the profile to rename. | yes |
<new-profile-name> | string | New name of the profile. | yes |
Output
The command output looks similar to the following if the command succeeds. If the command prints errors, see Troubleshooting for recommended solutions.
The profile <existing-profile-name> was renamed to <new-profile-name>.
Example
The following example uses the mongocli config rename
command
to rename the example1
profile to sample2
.
mongocli config rename example1 sample2
The preceding command prints the following output to the terminal:
The profile example1 was renamed to sample2.