Mar 09, 2023

Public workspaceCreate a MongoDB Atlas cluster  V.1

  • Mateusz Jundzill1,2,
  • Riccardo Spott1,
  • Mara Lohde1,
  • Martin Hölzer3,
  • Adrian Viehweger4,
  • Christian Brandt1,5,2
  • 1Institute for Infectious Diseases and Infection Control, Jena University Hospital, Jena, Germany;
  • 2Leibniz Center for Photonics in Infection Research (LPI), Jena 07747, Germany;
  • 3Methodology and Research Infrastructure, Bioinformatics and Systems Biology (MF1), Robert Koch Institute, Berlin 13353, Germany;
  • 4Medical Microbiology and Virology, University Hospital Leipzig, Leipzig 04103, Germany;
  • 5InfectoGnostics Research Campus, Jena 07747, Germany
Icon indicating open access to content
QR code linking to this content
Protocol CitationMateusz Jundzill, Riccardo Spott, Mara Lohde, Martin Hölzer, Adrian Viehweger, Christian Brandt 2023. Create a MongoDB Atlas cluster . protocols.io https://dx.doi.org/10.17504/protocols.io.rm7vzb1r5vx1/v1Version created by Mateusz Jundzill
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: February 21, 2023
Last Modified: March 09, 2023
Protocol Integer ID: 77369
Keywords: MongoDB, MongoDB Atlas, database, data administration
Abstract
A step-by-step guide on setup process for MongoDB Atlas tailored for data administrators with limited IT knowledge.
MongoDB Atlas set up
MongoDB Atlas set up
Create an account on MongoDB website.
Create an organization. Select Create a new organization and name your organization with e.g. the name of the institute or the group responsible for data administration. In the Select Cloud Service window, choose MongoDB Atlas and proceed to the next step. In the final step, add additional members by sending invitation emails or proceed by selecting Create Organisation.

Note
An organization is used for billing purposes and as a way to organize teams of users and projects. One organization can contain multiple projects.

Being a team member of the organization is not required for accessing the database.

Create a project. Select New project and name the project.

Note
The name of a project should be short and descriptive, particularly when multiple projects exist. We recommend naming the project after the working group name or the purpose.

Note that the project name is not the same as the database or collection name.


Create a cluster. Select Build a database then Shared cluster tier and confirm by Create.


Choose a cloud provider and region. Name your cluster in the Cluster Name section.
Note
The server provider and location should be selected based on the preferred data protection policies of the user's country or institution. If the administrator doesn't provide any requirements, a good rule of thumb is to choose the closest cluster to your location.

The available locations are not the same between cloud providers.

Go to the Additional Settings tab and turn Termination Protection and confirm by selecting Create Cluster.

Note
Termination Protection prevents accidental cluster deletion.

Create user profiles. Go to the Database access tab and select Add New Database User.

In the Password Authentication section, enter the name of the user (users can be created for each person accessing the database or for a specific function) and create a password. The password can either be autogenerated or entered manually.


Safety information
After creating the account, remember to copy the credentials as the passwords will be hidden for security reasons.


In the Database User Privileges section assign roles to the user, you can use pre-prepared template roles such as Admin, Read/Write, and Read from the Built-in Role section.

If there are multiple databases or collections, you can assign roles to specific elements of the cluster to fine-tune access in the Specific Privileges section.


Note
To ensure security and stability, we recommend creating at least one user for each Built-in Role. It should be avoided to use of the Admin role for routine tasks.


Limit IP addresses. Go to the Network Access tab.


Depending on the security protocols three approaches can be chosen:
1. Allow Access From Anywhere
2. Specify IP addresses in Access List Entry (the current machine can be added by selecting Add Current IP Address)
3. Select the IP address range in CIDR notation in Access List Entry
Note
CIDR notation examples:
188.225.0.1/32 will allow access only for 188.225.0.1 address
188.225.0.1/24 will allow access for range 188.225.0.XXX
188.225.0.1/16 will allow access for range 188.225.XXX.XXX

Optionally it is possible to use online tools to convert IP address lists to CIDR notation Example: ARIN

Safety information
Allow Access From Anywhere is not recommended, as it may result in unauthorized access to the cluster.

Create a database and a collection. Go to the Database tab, choose Browse Collections and then Add My Own Data. Name your first database and collection.


Note
To ensure compatibility and clarity, avoid using special characters(e.g.: “$,(,§,%” ) or non-standard English characters in the database and collection names. It's also recommended to keep the names concise.

Note that you can always add additional databases and collections later on.
MongoDB Compass Access
MongoDB Compass Access
Obtaining connection string. Go to the Database tab, pick Connect and then choose Connect using MongoDB Compass. Finally copy the connection string.

Database access via MongoDB Compass. Download and install MongoDB Compass from MongoDB website. Copy the connection string obtained in Go togo to step #8 MongoDB Compass Access , and paste it in the URI box in MongoDB Compass, making sure to replace <username> and <password> with your credentials. Alternatively, you can fill in the username and password under the Advanced Connection Options section.

Note
Connection strings with usernames and passwords can be saved by selecting Favourite in the upper right corner of the window.

Please note that the Favorite option will also save your username and password. If you want to save connection strings on a shared computer, it is recommended to remove your credentials before saving and enter them later in the Advanced Connection Options section.


Data import. Data import can be performed in two ways by using:
  • MongoDB Compass
  • Command line
Step case

MongoDB Compass
4 steps

Prepare a CSV file for the input.

The input file opened in a text editor should look like the given example:
Header1,Header2,Header3
Value1,Value2,Value3
Value4,Value5,Value6

Connect to the database as explained in the section Go togo to step #8 MongoDB Compass Access . Select Add Data.

Select Import File and choose the file that you want to upload data from. Pick CSV in the Select Input File Type section.

If the file is in the proper format, the Specify Fields and Types table should appear, which provides an overview of the imported data and allows for the specification of key types. Once you have verified the information, pick Import to complete the process



Upon successful import, you should see a confirmation message stating Import completed. Verify the number of documents imported to ensure that the import was successful