Skip to content

Latest commit

 

History

History
63 lines (35 loc) · 3.2 KB

DATABASE.md

File metadata and controls

63 lines (35 loc) · 3.2 KB

2. Database Creation

database-creation.mp4

2.1 Configure and Run a Database

  1. Log into your DigitalOcean account.

  2. Open "Manage > Databases" in the left menu.

    Open Manage > Databases.

  3. Click the blue "Create Database" button.

    Create database.

  4. The default choices should be correct for this lab. Click "Create Database Cluster" at the bottom of the page.

    Default choices screenshot.

  5. caution Provisioning your database will take about 5 minutes. Might be time to refill your water, or grab a quick snack.

2.2 Setup Compass

REMINDER: You won't be able to complete this step until your database is provisioned.

  1. Download and install MongoDB Compass if not already installed.

  2. Copy your connection string from the DigitalOcean console. (It will copy the password automatically.)

    Copy your connection string.

  3. In Compass, click on "Connections" and select "New Connection" in the left panel.

    Set up New Connection in Compass

  4. Paste the connection string into the "URI" field.

  5. Give the connection a name and choose a color if you prefer, then click "Save & Connect".

2.3 Setup Database in Compass

  1. Click on the "Create Database" button next to the name of the connection. It looks like this, ➕ (a plus symbol).

  2. For the "Database Name", use funko-database.

  3. For the "Collection Name", use the name funko-collection.

    Enter database name

2.4 Import Data

  1. Download this starter JSON data file to your machine. (download)

  2. Click the "Import Data" button to add the JSON file.

    Import data into database

  3. Click "Import" to upload your data to your collection.

    Click the import button to add data to the database

  4. Congratulations! You've created your database!

As you looked at the data we imported, you should have noticed an empty "imageUrl" field for each one. We will need to create some storage to hold these images, and then we will need to update our data to point to those images.

Imported Data

Next Up: Storage Creation