Articles → MONGODB → $Expr Operator In Mongodb

$Expr Operator In Mongodb






Purpose





Example




Picture showing the sample collection in mongodb




db.mycollection.find({
  $expr: {
    $gt: ["$spent", "$budget"]
  }
})



Output


Picture showing the output of $expr operator in mongodb





Posted By  -  Karan Gupta
 
Posted On  -  Monday, April 8, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250