I'm trying to add field only when a certain condition is met, for example, if an array size > 0 then use $addFields to add field "date", otherwise don't add it.
- when using
$condits a boolean so I have to add a field with either date value or false - When using
ifI have to provideelse,thenconditions
Any ideas on how to achieve this?