I had it working like this:
db.getCollection("Test").aggregate([
{
$addFields:{
assignee2:{
$cond:{
if:{$gt:['$assignee', null]},
then:'$assignee',
else:{}
}
}
}
}
])
You could also use $ifNull:
db.getCollection("Test").aggregate([
{
$addFields:{
assignee2:{
$ifNull:[
'$assignee',
{}
]
}
}
}
])
There is a similar post here: