I have an array like below for multiple documents.
meta: [1, null]
I want to get rid of the null value. So the array just looks like
meta: [1]
I tried with $unset
.updateMany({}, { $unset: { 'meta.1': 1 } }, { multi: true });
However, it doesn't remove null value. How can I keep the value 1 but just take off null from the array?