Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have those instuctions: Load the database by executing the following at the Linux command line in the terminal you opened: cd / usr /
I have those instuctions: Load the database by executing the following at the Linux command line in the terminal you opened:
cd usrlocaldatasets
mongoimport username$MONGOUSER
password$MONGOPASSport$MONGOPORT
host$MONGOHOSTdb enron collection emails
authenticationDatabase admin drop enronjson
Note: You must type in the previous commands because cutting and pasting will generate an incorrect character for quotation marks. The MongoDB instance set up in your Apporto virtual lab has an administrative user configured, and the four environment variables MONGOUSER, MONGOPASS, MONGOPORT, and MONGOHOST are preconfigured in your environment. Each of these must be added to the mongoimport command because the database is not running on the same machine that is running your virtual lab. The drop option allows you to run the command several times without worrying about duplicate information being loaded into the database.
Retrieve a document from the collection by executing the following commands in the mongo shell. Take a screenshot to verify your execution of these commands.
show dbs #lists directory of databases
use enron #this sets db to the enron database
show collections #lists directory of collections
dbemails.findOne #retrieves a document from the emails collection
Execute the command to find the size of a single document of your choosing from the enron database. Refer to Two Ways to Get a Document's Size in MongoDB or the textbook if you need help constructing this command. Take a screenshot to verify your execution of this command.
Note: For this command to work, you may need to activate compatibility with legacy versions of the mongo shell. You accomplish this by entering the following at the shell prompt:
snippet install mongocompat
Answer yes to the two questions the shell asks, and you should be all set.
Execute the command to find the size of the collection of documents in the enron database. Refer back to the Two Ways to Get a Documents Size in MongoDB article if you need help constructing this command. Take a screenshot to verify your execution of this command.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started