Simple, self-explanatory code snippets.
db.test1.update(
{
"filter_field": 1,
},
[
{$set: {
"target_field": "$source_field"
}}
]
);
{$cond: {
if: {$eq: [ {$ifNull: ["$FIELD_NAME", null]}, null ]},
then: NumberInt(0),
else: NumberInt(1)
}},