Můžete porovnat qTyIn
s undefined
v rámci $filter
:
db.collection.aggregate([
{
$addFields: {
transactions: {
$filter: {
input: "$transactions",
cond: {
$ne: [ "$$this.qtyIn", null ]
}
}
}
}
}
])