Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have the instructions below. This is what I am entering: ( base ) sylviatrynkin _ snhu@nv - snhu 7 - l 0 1 :

I have the instructions below. This is what I am entering:
(base) sylviatrynkin_snhu@nv-snhu7-l01:/usr/local/datasets$ mongoimport--username="${MONGO_USER}"--password="${MONGO_PASS}"--port=${MONGO_PORT}--host=${MONGO_HOST}--db enron--collection emails--authenticationDatabase admin--drop ./enron.json
and this is the error I get:
mongoimport--username=root--password=tBi3VFkeCw--port=31860--host=nv-desktop-services.apporto.com: command not found
(base) sylviatrynkin_snhu@nv-snhu7-l01:/usr/local/datasets$
instructions: Load the database by executing the following at the Linux command line in the terminal you opened:
cd /usr/local/datasets
mongoimport --username="${MONGO_USER}"\
--password="${MONGO_PASS}"--port=${MONGO_PORT}\
--host=${MONGO_HOST}--db enron --collection emails \
--authenticationDatabase admin --drop ./enron.json
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 MONGO_USER, MONGO_PASS, MONGO_PORT, and MONGO_HOST are pre-configured 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
db.emails.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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions