What query would you use to find documents where the 'age' field is less than 30 or the 'status' is 'A'? - Study24x7
Social learning Network
5 followers study24x7 30 Dec 2024 10:50 AM study24x7 study24x7

What query would you use to find documents where the 'age' field is less than 30 or the 'status' is 'A'?

A

db.collection.find({age: {$lt: 30}, status: "A"})

B

db.collection.find({$or: [{age: {$lt: 30}}, {status: "A"}]})

C

db.collection.find({age: {$lt: 30} || {status: "A"}})

D

db.collection.find({age: {$lt: 30}, status: {$eq: "A"}})

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles