I'm trying to delete some fields on my mongodb database but instead the fields are just getting mutated to a null value and that's an issue because when fetching data im using loops and they get broken passing true null
value ... for deleting data i'm using the following :
User.updateOne({_id : user._id } ,{ $unset :{ "days.0.tasks.0" = "" })
what i'm getting :
Is there a way to delete entirely the objects inside the tasks array?