Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Working with MongoDB

There are often times that you will be called upon in your journey to assist in the testing of a new technology. In this hands-on lab, you will be installing MongoDB. Once it has been installed, you will be bulk inserting data to be used by your Dev team for testing.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
Clock icon May 24, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Install MongoDB version 4.0

    1. Add the YUM repository for the repo as sudo:

      sudo su
      
      cat << EOF > /etc/yum.repos.d/mongodb-org-4.0.repo
      [mongodb-org-4.0] 
      name=MongoDB Repository 
      baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/ 
      gpgcheck=1 
      enabled=1 
      gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc 
      EOF
      
    2. Install and start MongoDB:

      yum install -y mongodb-org
      
      service mongod start
      
  2. Challenge

    Insert the test data located in /home/cloud_user/data/cities.csv

    1. As the regular user, run the mongoimport command:

      mongoimport -d cities -c cityinfo --type CSV --file '/home/cloud_user/data/cities.csv' --headerline
      
  3. Challenge

    Validate that the data has the required entries

    1. This is done from the mongo shell:

      mongo
      
      use cities
      
      db.cityinfo.find({State:"GA"})
      

      This should return four records.

    2. Exit the mongo shell.

    3. Exit the server.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans