Setting Up the Database
Retrieving a MongoDB URI
We will be using Mongo DB Atlas, you do not need a credit card to obtain a free tier database cluster.
https://www.mongodb.com/cloud/atlas
- Create an account by clicking the “Start free” button.
- Look for the ones that have the following label. We recommend choosing a server near your Discord Server region.
Free Tier Available
- Be sure you’re on the M0 Sandbox tier, this is the only free tier offered by MongoDB Atlas. Choosing anything else will require payment.
- Don’t enable Additional Settings and set anything as the cluster name.
- Look for the following box on the bottom left of the screen, if it’s not there, wait for a minute and then refresh the page.
Get Started4
- Complete the remaining steps, skip the optional “Load Sample Data” step. Read through #7 - #9 before completing this step.
- User should have either “Atlas admin” or “Read and write to any database” permission.
- You will need to remembed the User password, do not include any symbols or special characters as they often cause problems with authentication.
- When Whitelisting IP, if you’re hosting from Heroku, you must select “ALLOW ACCESS FROM ANYWHERE” or enter “0.0.0.0/0” as the Whitelist Entry.
- The last “Connect to your cluster step” (if the “Connect” button is grayed out, wait, it can take up to 20 minutes), select “Connect Your Application”, leave the “driver version” as-is (Node.js 3.0 or higher), copy down the “Connection String”, which looks similar to:
mongodb+srv://admin:<password>@modmail-apsk.azure.mongodb.net/test?retryWrites=true&w=majority
. - Paste the connection string from #10 and the password from #8 into their respective forms below. Do not subsitute in
<password>
, the form will correctly do so for you.