Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Latest commit

 

History

History
59 lines (30 loc) · 2.56 KB

File metadata and controls

59 lines (30 loc) · 2.56 KB

MongoDB Setup

  • Create a free account on MongoDB Atlas at cloud.mongodb.com. Click on “Get Started Free” if you do not have an account or “Sign In” if you already have a login. Then create your account/sign in as required.

  • Under the 'Starter Clusters' box (left-hand side), click 'Create a cluster'
  • Select GCP as the Cloud Provider and then Belgium as the region

  • Confirm the the 'M0 Sandbox' Cluster Tier is selected, then click create cluster

  • While this spins up, lets click on the “Database Access” submenu, under “Security” on the left menu, then 'Add New User'.
  • Enter a user name. For our demo, let’s enter mdbadmin and enter a secure password. Record your user name and password in a safe location for reference later. Under “User Privileges”, select “Atlas admin” and click on the “Add User button to complete this section.

  • Lets click on the “Network Access” submenu, under “Security” on the left menu. Click on “Add IP Address”.

  • Select “Allow Access from Anywhere” for the purpose of this demo, select "Save as temporary whitelist" and click on “Confirm”.

Note: When running a cluster in production, you will want to narrow the scope of where your database can be accessed and specify a specific IP address/CIDR block and/or using VPC peered connection. For this demo we are creating a temporary whitelist entry which will automatically be removed after the specified period of time, preventing general access to the cluster.

  • Go to “Clusters” submenu, under “Atlas” on the left menu, then click "Collections" for your cluster (you may need to wait a little longer for the cluster to be fully created).
  • Click "Add My Own Data"

  • Create a database called gcpdemo with a collection called democol
  • Go to “Clusters” submenu, under “Atlas” on the left menu, then click "Connect"
  • A window will open. Select “Connect Your Application.”

  • Choose Python and version >3.6 then copy the connection string they give you and save it somewhere handy - We will need this later.