Question: Assignment 4 Instruction: Include a full screenshot that shows the code and the output for each question. You are given a MongoDB collection named employees

Assignment 4
Instruction:
Include a full screenshot that shows the code and the output for each question.
You are given a MongoDB collection named employees with documents having the following
structure:
{id: Objectld(60c940888b64832e448a7b0f), name: JohnDoe, age: 35, department:
IT, salary: 60000}
{id: Objectld(60c940888b64832e448a7b10), name: BobJohnson, department: Sales,
salary: 62000, manager: AliceSmith}
{id: Objectld(60c940888b64832e448a7b11), name: EmilyBrown, department: HR,
salary: 58000, manager: AliceSmith}
Write MongoDB queries to perform the following operations:
a) Retrieve all documents where the age is greater than 30 and the department is 'Sales'.
b) Retrieve all documents where the salary is greater than 50000 or the age is less than 25.
c) Retrieve all documents where the department is either 'HR' or 'Finance' and the age is less than
or equal to 40.
d) Retrieve all documents where the salary is greater than or equal to 70000 and the department is
not 'IT'.
e) Retrieve all documents where the name is not equal to 'John Doe' and the department is not
equal to 'HR'.|
Assignment 4 Instruction: Include a full

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!