I was trying to figure out if mongo can remove an array element by index:
In mongoDb, how do you remove an array element by its index
The top answer mentions a workaround:
db.lists.update({}, {$unset : {"interests.3" : 1 }})
db.lists.update({}, {$pull : {"interests" : null}})
This got me wondering, if one were to combine these two commands, would mongo execute them in order? For example:
db.lists.update({}, {
$unset : {"interests.3" : 1 },
$pull : {"interests" : null}
})
Would mongo execute in order the $unset first, and then the $pull?