Navigation

Connect to Your Data Lake

Beta

The Atlas Data Lake is available as a Beta feature. The product and the corresponding documentation may change at any time during the Beta stage. For support, see Request Support.

Estimated completion time: 15 minutes

This part of the tutorial will walk you through connecting to your Data Lake using the Mongo shell.

Prerequisites

To complete this part of the tutorial, you will need to have completed:

Whitelist Your Connection IP Address

Note

If your IP is already whitelisted and you created a MongoDB user, you can skip to Connect to Your Data Lake Using the Mongo Shell.

Estimated completion time: 2 minutes

An IP address is a unique numeric identifier for a device connecting to a network. Within Atlas, you can create a list of trusted IP addresses that can connect to your Data Lake and access your data. Atlas only allows connections to a Data Lake from addresses listed in the IP whitelist.

1

Click Connect in the second box.

Image highlighting the Data Lake connect box.
2

Configure your whitelist entry.

In the Whitelist your connection IP address step, click Add Your Current IP Address.

3

Click Add IP Address.


Screeenshot of adding a new whitelist entry.

Create a MongoDB User for Your Data Lake

Note

If your IP is already whitelisted and you created a MongoDB user, you can skip to Connect to Your Data Lake Using the Mongo Shell.

Estimated completion time: 2 minutes

You must create a MongoDB user to access your deployment. For security purposes, Atlas requires clients to authenticate as MongoDB users to access Data Lakes.

To add a MongoDB user to your cluster:

1

In the same Connect dialog, enter your user information.

  1. In the Create a MongoDB User step of the dialog, enter a Username for your MongoDB user. For this tutorial, we’ll use MyMongoDBUser as an example username.
  2. Enter a Password for your user. You’ll use this username and password combination to access data on your cluster.

Screeenshot of adding a new user.

Note

If your password contains special characters, you will need to encode them. For more information, see Special characters in connection string password.

2

Click Create MongoDB User.

See also

For information on configuring additional MongoDB users on your cluster, see Configure MongoDB Users.

Connect to Your Data Lake Using the Mongo Shell

Connecting to your Data Lake depends on whether you have the Mongo shell installed:

1

Click Connect with the Mongo Shell.

Image highlighting the Data Lake connect box.
2

Click I have the Mongo Shell Installed.

3

Select your Mongo Shell version.

8

Connect to your Data Lake using the Mongo shell.

  1. Copy the connection string from the Atlas user interface.
  2. Paste it into your command line.
  3. Execute the command to connect to your Data Lake.
1

Click Connect with the Mongo Shell.

Image highlighting the Data Lake connect box.
2

Click I do not have the Mongo Shell Installed.

3

Select your operating system.

Select your operating system from the dropdown in step 1 of the dialog.

4

Download the Mongo shell.

  • If you are using Windows or Linux, you can choose to either download the shell directly, or fetch the shell via URL.
  • If you are using macOS, you can use the provided Homebrew command to download the shell.
5

Add the Mongo shell to your system path.

To run the Mongo shell from your terminal, you will need to add the shell to your system path. Select the appropriate tab based on your operating system:

  1. Double-click the .msi file in Windows Explorer and proceed through the installation wizard.
  2. Add the bin directory to your command path.
    1. Click windows icon and select Control Panel.
    2. Click System and Security, then System, then Advanced System Settings.
    3. Click Environment Variables.
    4. Select Path and click Edit.
    5. Add the bin directory where the installer placed your MongoDB executables and click OK.

Copy the Homebrew command from the Atlas UI window and run it in your terminal.

  1. Run the following command in your terminal to extract the Mongo shell:

    tar -xzf ./<filename>.tgz
    
  2. Add the bin directory to your PATH environment variable.

    export PATH=/<extraction-directory>/bin:$PATH
    

    Note

    This command applies only to the current shell session. Edit the PATH environment variable in ~/.profile to update the variable across shell sessions and reboots.

You should now be able to run the Mongo shell using your terminal.

6

Test your Mongo shell installation.

To see if you have correctly added the Mongo shell to your system path, run the following command in your terminal:

mongo --version

You should see an output similar to the following:

MongoDB shell version v4.0.7
git version: 7c13a75b928ace3f65c9553352689dc0a6d0ca83
allocator: system
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64
7

Connect to your Data Lake using the Mongo shell.

  1. Copy the connection string from the Atlas user interface.
  2. Paste it into your command line.
  3. Execute the command to connect to your Data Lake.

Next Steps

Now that you’re connected to your Data Lake, proceed to Configure Your Database and Collections.