Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ou have been asked to import a file for the Grazioso Salvare project. In order to do so , you must complete the following steps:

ou have been asked to import a file for the Grazioso Salvare project. In order to do so, you must complete the following steps:
You have been asked to import a file for the Grazioso Salvare project. You must perform the following steps to do so:
In Apporto, open the terminal window to access the Linux shell. Upload the Austin Animal Center (AAC) Outcomes data set into MongoDB by importing a CSV file using the appropriate MongoDB import tool. Use the database name AAC and collection name animals. Complete the import using the mongoimport tool, and take screenshots of both the import command and its execution.
Tip: How to import a CSV file is covered in the mongoimport documentation in the Module Three Resources Additional Support section. The command you use should be like the ones used in Module One Assignment and Module Two Assignment. (The requirements and rubric documents contain examples for the mongoimport command, but these use the default JSON datatype; adjust the command to import a CSV file.) Youll find the Austin Animal Center (AAC) Outcomes data set in the /usr/local/datasets/ directory. The file name is aac_shelter_outcomes.csv.
After importing your data set, open the mongo shell. Create a simple index on the key breed. Show an example query using this index, and use the explain function to verify that the index will be used. Take screenshots of your example query.
Create a compound index that will improve the performance of queries looking for breeds that have an outcome_type of Transfer. Show an example query using this compound index, and use the explain function to confirm the index will be used. Take screenshots of your example query.
Part II: User Authentication
The client has asked you to comply with their security needs and ensure user authentication to the database by setting up both administrator and user accounts. Your administrator account has already been configured on your database in Apporto. So, you will only have to create a user account. To do so, follow the steps below.
Create a new user account called aacuser for the database AAC in the mongo shell. Refer to steps 67 of the MongoDB Manual Enable Access Control tutorial for help with this task. You will need to modify the commands so the account name is aacuser. Additional information with respect to user management may be found in the User Management in MongoDB document.
Note: You will need to create your user in the admin database, even though it will only have a role in the aac database. When you use the mongo shell (mongosh) to connect to the database with your user account, you will need to reset two environment variables to reflect the username and password you just created. (The MongoDB hostname and port will be pulled automatically from your environment variables.)
Tip: To make it easier to log in as your user, open up a second terminal session in your Linux environment. In this session, set the following environment variables:
MONGO_USER=aacuser
MONGO_PASS=The password you set when you created the aacuser account.
Once this is complete, you can run mongosh in that window as your new user.
Example:
The image shows an example of how to run mongosh in a window as a new user with the variables provided above. The following contains a line of code with symbols. Please adjust the verbosity settings on your screen reader accordingly. Line 1: (base) fmanning_snhu@nv-snhu3-100:/usr/local.datasets$ MONGO_USER-accuser Line 2: (base)_fmanning-snhu@nv-snhu3-100:/usr/local/datasetes$ MONGO_PASS-SNHU1234 Line 3: (base) fmanning_snhu@nv-snhu3-100:/usr/local/datasets$ printenv /grep -{ mongo Line 4: MONGO_USER=accuser Line 5: MONGO_HOST=nv.desktop-services.apporto.com Line 6 MONGO_PASS=SNHU1234 Line 7: MONGO_PORT-31580 Line 6: (base) fmanning_snhu@nv-snhu3-100:/usr/local/datasets$ mongosh Line 7: Current Mongosh Log ID: 63a4334981d9cf146cbb4e95 Line 8: Connecting to: mongodb://

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

Students also viewed these Databases questions