Answered step by step
Verified Expert Solution
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 usrlocaldatasets directory. The file name is aacshelteroutcomes.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 outcometype 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 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:
MONGOUSERaacuser
MONGOPASSThe 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 : base fmanningsnhu@nvsnhu:usrlocaldatasets$ MONGOUSERaccuser Line : basefmanningsnhu@nvsnhu:usrlocaldatasetes$ MONGOPASSSNHU Line : base fmanningsnhu@nvsnhu:usrlocaldatasets$ printenv grep mongo Line : MONGOUSERaccuser Line : MONGOHOSTnvdesktopservices.apporto.com Line MONGOPASSSNHU Line : MONGOPORT Line : base fmanningsnhu@nvsnhu:usrlocaldatasets$ mongosh Line : Current Mongosh Log ID: adcfcbbe Line : Connecting to: mongodb:
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