Fixed 3rd query, added or thingy.

This commit is contained in:
K 2024-11-09 11:50:08 +05:30
parent 86ba61f9c3
commit ff283c93df
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

View File

@ -118,9 +118,11 @@ db.Employee.updateOne(
3. Selects all documents in the collection where the field age has a value less than 30 or the value of the salary field is greater than 40000.
```json
db.Employee.find(
{
Age: { $lt: 30 },
Salary: { $gt: 40000 }
{ $or:
[
{ Age: { $lt: 30 } },
{ Salary: { $gt: 40000 } }
]
}
)
@ -155,3 +157,4 @@ db.Employee.find(
```
---