#1 MongoDB
Last updated
Was this helpful?
Last updated
Was this helpful?
MongoDB is the database we will use with the Todo List app. We will use a free service that provides a cloud hosted MongoDB called MongoDB Atlas.
In MongoDB Atlas we first need to create a cluster to house the database. We .
We'll also summarize the main steps below: 1. Create an account on . 1. When prompted, select the Starter Clusters to create a free MongoDB instance. 1. Choose all the default options on the Create a Starter Cluster page and select Create Cluster. It may take up to 15 minutes to prepare the cluster. 1. Once you see information about Cluster0 in SANDBOX, your cluster is ready.
We .
We'll also summarize the main steps below: 1. In the Cluster0 panel, press the COLLECTIONS button. 1. Then select Add my own data when asked. 1. In the Create Database dialog, type "todo-list" as the DATABASE NAME and "todo-list-items" as the COLLECTION NAME. Press Create.
In order for the server to work without editing, you must use the names "todo-list" for the database name and "todo-list-items" for the collection name.
You created a database! You're almost there! β¨
Now that we have a database, we need the connection information for the server to communicate with the database. We will now get the connection string. We .
We'll also summarize the main steps below: 1. Return to the Clusters page by selecting Clusters in the navigation list on the left side of the page. 1. Press the Connect button to bring up a dialog to Connect to Cluster0. 1. Press the green Add Your Current IP Address button, then press Add IP Address button. 1. You may need to create a MongoDB User. Follow the instructions to add a username and password and press Create MongoDB User button. Press the Choose a connection method button. 1. When prompted to choose a connection method, select Connect Your Application. You now see your connection string. Press the Copy button to save a copy to your computer's clipboard and paste it where you can edit it. 1. Replace the <password>
part with your password for the MongoDB user.
Your connection string is ready to use.