I have read the documentation and searched all over but I can't find how to do it. If I have a document inside a collection and the document is an empty array I can remove it like this:
db.data.remove(array('document'=>array()))
or like this:
db.data.remove(array('document'=>[]))
But if the array is not empty it doesn't work, so I tried like this:
db.data.remove(array('document'=>array('$type'=>4)))
Am I doing it wrong? Is there any way to do this? Removing the document on another criteria isn't useful for me.