2021-11-12

MongoDB - Project a value based on the existance of a field

 {$cond: {

    if: {$eq: [ {$ifNull: ["$FIELD_NAME", null]}, null ]},

    then: NumberInt(0),

    else: NumberInt(1) 

}},


No comments:

Post a Comment