Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas whitelist delete

On this page

  • Syntax
  • Options
  • Output
  • Examples

The whitelist delete command deletes the specified whitelist entry in the specified Atlas project. The command prompts you to confirm the operation when you run the command without the --force option.

You can also delete a whitelist entry by using the Atlas UI or API.

mongocli atlas whitelist delete|rm <whitelist-entry>
[ --force ]
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]
Option
Type
Description
Required?
<whitelist-entry>
string
IP address, AWS security group ID, or CIDR block of the whitelist entry to delete.
yes
--force
Flag that indicates that the whitelist entry can be deleted without requiring confirmation.
no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile to use for accessing the Atlas project. If omitted, uses the default profile.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

The command prints a confirmation message similar to the following to the terminal if it succeeds. If the command prints an error, see Troubleshooting for recommended solutions.

Project whitelist entry '<whitelist-entry>' deleted

The following examples use the mongocli whitelist cluster delete command to delete the sample IP address 192.0.2.0.

The following mongocli atlas whitelist delete command deletes the IP address 192.0.2.0 after prompting for a confirmation. The command uses the default profile to access the Atlas project.

mongocli atlas whitelist delete 192.0.2.0 --projectId 5e2211c17a3e5a48f5497de3
? Are you sure you want to delete: 192.0.2.0 Yes

The command prints the following to the terminal:

Project whitelist entry '192.0.2.0' deleted

The following mongocli atlas whitelist delete command uses the --force option to delete the IP address 192.0.2.0 without confirmation. It uses the profile named egAtlasProfile to access Atlas project.

mongocli atlas whitelist delete 192.0.2.0 --projectId 5e2211c17a3e5a48f5497de3 --force --profile egAtlasProfile

The command prints the following to the terminal:

Project whitelist entry '192.0.2.0' deleted

Back

Create a whitelist entry