How would you find documents where the 'age' field exists and is not equal to 25? - Study24x7
Social learning Network
5 followers study24x7 27 Dec 2024 12:42 PM study24x7 study24x7

How would you find documents where the 'age' field exists and is not equal to 25?

A

db.collection.find({age: {$ne: 25, $exists: true}})

B

db.collection.find({age: {$exists: true, $ne: 25}})

C

db.collection.find({age: {$not: 25}})

D

db.collection.find({age: {$exists: true}, age: {$ne: 25}})

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