mongocli atlas quickstart¶
The mongocli atlas quickstart
command creates an M2
cluster in
the specified Atlas project. You can either specify the options
with the command or omit the options and run the command in interactive
mode. That is, if you do not specify one or more required options with
the command, the command prompts you for the settings for those
options. If you do not yet have a default profile, the command provides
the links to:
Use this command to get started with MongoDB Atlas.
The command takes a few minutes to create the cluster; you can press
Ctrl+C
to return to the command line while the operation
completes in the background.
Syntax¶
mongocli atlas quickstart --accessListIp <IP-addresses> --clusterName <cluster-name> --password <user-password> --profile|-P <profile-name> --projectId <project-ID> --provider AWS|GCP|AZURE --region|-r <region-name> --skipMongosh --username <name-of-user>
Use -h
or --help
to view the command-line help for
this command.
Options¶
All of the following options are required to run the command in non-interactive mode. To run the command in interactive mode, you don't need to specify any of the following options with the command.
Option | Type | Description |
---|---|---|
--accessListIp | string | List of IP addresses to add to the project access list.
Atlas only allows connections to a cluster from addresses
listed in the IP access list. If you do not specify an IP
address, MongoDB CLI detects and adds your public IP address to
the project access list. |
--clusterName | string | Name of the cluster. The cluster name cannot be changed after
you create the cluster. Cluster name can contain ASCII letters,
numbers, and hyphen. If you do not specify a name for the
cluster, defaults to Quickstart_{epoch} where {epoch} is
the date range represented as milliseconds elapsed since the
UNIX epoch. |
--password | string | Password for authenticating the user to MongoDB using
SCRAM-SHA . In interactive mode, MongoDB CLI auto-generates a
password in interactive mode if you do not specify a password. |
--profile , -P | string | Name of the profile where the public and private keys for the
project are set. If omitted, uses the default profile. To
learn more about creating a profile, see Configure the MongoDB CLI. |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. |
--provider | string | Cloud service provider on which the servers are provisioned. Value can be:
If you do not specify the provider, defaults to |
--region , -r | string | Physical location of the MongoDB cluster. Select your cloud provider tab to view the available regions:
For a complete list of supported AWS regions, see
Amazon Web Services (AWS). If you don't specify
a region, defaults to |
--skipMongosh | boolean | Flag that specifies whether or not to download and install the
If you do not specify a value, defaults to |
--username | string | Username for authenticating the user to MongoDB. In interactive
mode, the default value is the same as the default cluster name. |
Output¶
If the command succeeds, the command prints the following output to the terminal.
Now you can connect to your Atlas cluster with: mongosh -u <username> -p <user-password> mongodb+srv://<cluster-name>.7hgjn.mongodb.net
The command prints output similar to the following to the terminal if
you run the command in the background by pressing Ctrl+C
.
You can connect to your Atlas cluster with the following user: username: <username> password: <user-password>
If the command returns errors, see Troubleshooting for recommended solutions.
Examples¶
The following mongocli atlas quickstart
commands create a cluster
named QuickstartCluster
in the Atlas project. The command uses
the default profile for accessing the Atlas project.
mongocli atlas quickstart --clusterName QuickstartCluster --provider AWS --region US_EAST_1 --username testUser --password changeMe --accessListIp 192.0.2.15 --skipMongosh
The command prints the following output to the terminal after it completes:
Now you can connect to your Atlas cluster with: mongosh -u testUser -p changeMe mongodb+srv://quickstart-1616794174.7hgjn.mongodb.net
The command prints the following to the terminal if you press
Ctrl+C
:
You can connect to your Atlas cluster with the following user: username: testUser password: changeMe