According to MongoDb docs, $cond "evaluates a Boolean expression to return one of the two specified return expressions". Syntax: { $cond : { if: < expression >, then: < true >, else: < false > } } OR { $cond : [<expression>, <true>, <false>] } Example for MongoDb if else statement db . customers . aggregate ( [{ $project: { C_Id: 1, C_Type: ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers