0
0
MongoDBquery~10 mins

MongoDB installation and setup - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start the MongoDB server.

MongoDB
mongod --[1] /data/db
Drag options to blanks, or click blank then click option'
Aport
Bdbpath
Cbind_ip
Dlogpath
Attempts:
3 left
💡 Hint
Common Mistakes
Using --port instead of --dbpath
Forgetting to specify the data directory
Using --logpath which is for logs, not data
2fill in blank
medium

Complete the command to connect to the MongoDB server using the shell.

MongoDB
mongo --[1] 27017
Drag options to blanks, or click blank then click option'
Ausername
Bdbpath
Chost
Dport
Attempts:
3 left
💡 Hint
Common Mistakes
Using --dbpath which is for the server, not the client
Using --host without specifying the port
Using --username without authentication setup
3fill in blank
hard

Fix the error in the command to start MongoDB with a custom log file.

MongoDB
mongod --dbpath /data/db --[1] /var/log/mongodb.log --fork
Drag options to blanks, or click blank then click option'
Alogfile
BlogfilePath
Clogpath
Dlogpathfile
Attempts:
3 left
💡 Hint
Common Mistakes
Using --logfile which is not a valid option
Using --logfilePath which is incorrect casing
Using --logpathfile which is not recognized
4fill in blank
hard

Fill both blanks to create a directory and set permissions for MongoDB data storage.

MongoDB
sudo mkdir -p [1] && sudo chown [2] [1]
Drag options to blanks, or click blank then click option'
A/data/db
Bmongodb
Croot
D/var/lib/mongo
Attempts:
3 left
💡 Hint
Common Mistakes
Using root as owner which can cause permission issues
Using wrong directory paths
Not creating the directory before changing ownership
5fill in blank
hard

Fill all three blanks to write a command that installs MongoDB on Ubuntu using apt.

MongoDB
sudo apt-get update && sudo apt-get install -y [1]-org && sudo systemctl [2] [3]
Drag options to blanks, or click blank then click option'
Amongodb
Bstart
Cmongod
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mongodb' without '-org' suffix
Using 'restart' instead of 'start' when first starting
Using wrong service name like 'mongodb' instead of 'mongod'