Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use MongoDB for all questions Initially, MongoDB will use the multikey index for searching documents where the grades array contains the first element (80) in
Use MongoDB for all questions
Initially, MongoDB will use the multikey index for searching documents where the grades array contains the first element (80) in any position. Then, within those selected documents, the documents with all the matching elements will be selected. V: Exercises 1- Create a new collection "project" in the "company" database with these key fields: (id, name, location, startDate, duration) 2- Insert 10 documents in "Project" collection that generate results for the following queries. 3- Without indexing, analyze the performance of the following query "Find projects with a duration between 1 month and 6 months". Do not forget to use print() to generate your performance analysis. 4- Enable indexing for the duration filed. 5- Repeat question 3 and explain your observation. 6- Find projects that are in these locations ("Toronto", "Ottawa", "Victoria"). 7- Find projects with names starting with "co" oR started at 2020. State the number of the returned results. 8- Analyze the query performance and speed. Do not forget to use print () to generate your performance analysis. 9- Drop the previous index. 10- Create a compound index on keys name and startDate. 11- Repeat question 7 and explain your observation on the indexing performance and improved query speed 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