
Oliver A. answered 06/05/24
Computer science expert with 5+ years of experience
Hey Femi! Here is a proposed solution to your prompt:
Using mongoimport to create the database and load documents:
This command imports the documents from "companies.json" into the "research" collection within the "companies" database.
Verifying the load: Execute the following queries in the MongoDB shell:
Take screenshots of the queries and their results as evidence.
Performing tasks using MongoDB queries:
- List the first 20 names of companies founded after 2010, ordered alphabetically:
- List the first 20 names of companies with offices in California or Texas, ordered by the number of employees (largest to smallest):
Take screenshots of the queries and their results.
Designing and implementing an aggregation pipeline:
This aggregation pipeline:
- Unwinds the "offices" array to have one document per office.
- Matches only offices in the United States.
- Groups the documents by state and calculates the total number of offices in each state.
Take screenshots of the aggregation pipeline and its results.
Finally, you can compile the screenshots and explanations into a Microsoft Word document (or equivalent) as specified in the assignment requirements.
I hope this helps!