From ff283c93df5d27380f81cb17ed6222a51bd48b32 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Sat, 9 Nov 2024 11:50:08 +0530 Subject: [PATCH] Fixed 3rd query, added or thingy. --- Practical/Practical Exam/MongoDB/M2 - Crud operations.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Practical/Practical Exam/MongoDB/M2 - Crud operations.md b/Practical/Practical Exam/MongoDB/M2 - Crud operations.md index b01a330..b8aa7f9 100644 --- a/Practical/Practical Exam/MongoDB/M2 - Crud operations.md +++ b/Practical/Practical Exam/MongoDB/M2 - Crud operations.md @@ -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( ``` --- +