问题
I had unset an array field, in mongo but it's leave the field with valué null,
the question is, how to remove it!
like this image http://i.stack.imgur.com/O2WiV.png
回答1:
You could remove all null elements from the array with the $pull operation.
See docs
Code example:
db.collecton.update({condition: "x"}, {$pull: {state: null}});
来源:https://stackoverflow.com/questions/19445508/how-to-remove-array-filed-with-value-null-after-unset-in-mongodb