Fixed some questions to match the queries.
This commit is contained in:
parent
37fc21421d
commit
e0d47201ee
@ -152,7 +152,7 @@ db.Employee.insertMany([
|
||||
db.Employee.find({ Designation: "Programmer", Salary: { $gt: 30000 } })
|
||||
```
|
||||
|
||||
2. Create a new document if no document contains `{Designation: "Tester", Company_name: "TCS", Age: 25}`:
|
||||
2. Create a new document if no document contains `{Designation: "Tester", Company_name: "Y-Space", Age: 25}`:
|
||||
```mongodb
|
||||
db.Employee.update(
|
||||
{ Designation: "Tester", Company_name: "Y-Space", Age: 25 },
|
||||
@ -174,7 +174,7 @@ db.Employee.find({ Address: { $elemMatch: { city: "Pune", Pin_code: "411001" } }
|
||||
|
||||
```
|
||||
|
||||
5. Find all documents with Company_name "TCS" and modify their salary by 2000:
|
||||
5. Find all documents with Company_name "Oscorp" and modify their salary by 2000:
|
||||
```mongodb
|
||||
db.Employee.updateMany(
|
||||
{ Company_name: "Oscorp" },
|
||||
@ -189,7 +189,7 @@ db.Employee.find({ Designation: { $ne: "Developer" } })
|
||||
|
||||
```
|
||||
|
||||
7. Find _id, Designation, Address, and Name where Company_name is "Infosys":
|
||||
7. Find _id, Designation, Address, and Name where Company_name is "Wayne Industries":
|
||||
```mongodb
|
||||
db.Employee.find(
|
||||
{ Company_name: "Wayne Industries" },
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user