- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

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.

Lab Info
Table of Contents
-
Challenge
Install MongoDB version 4.0
-
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
-
Install and start MongoDB:
yum install -y mongodb-org
service mongod start
-
-
Challenge
Insert the test data located in /home/cloud_user/data/cities.csv
-
As the regular user, run the
mongoimport
command:mongoimport -d cities -c cityinfo --type CSV --file '/home/cloud_user/data/cities.csv' --headerline
-
-
Challenge
Validate that the data has the required entries
-
This is done from the mongo shell:
mongo
use cities
db.cityinfo.find({State:"GA"})
This should return four records.
-
Exit the mongo shell.
-
Exit the server.
-
About the author
Real skill practice before real-world application
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.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.