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
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:
: Objectld name: JohnDoe, age: department:
salary:
: Objectld name: BobJohnson, department: Sales,
salary: manager: AliceSmith
: Objectld name: EmilyBrown, department:
salary: manager: AliceSmith
Write MongoDB queries to perform the following operations:
a Retrieve all documents where the age is greater than and the department is 'Sales'.
b Retrieve all documents where the salary is greater than or the age is less than
c Retrieve all documents where the department is either HR or 'Finance' and the age is less than
or equal to
d Retrieve all documents where the salary is greater than or equal to 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
