mongodb empty araay code example
Example 1: mongodb filter empty array
db.collection.find({arrayElementName : {$exists:true, $size:0}})
Example 2: mongodb empty an array field
db.collection.update({}, { $set : {'myArray': [] }} , {multi:true} )
db.collection.find({arrayElementName : {$exists:true, $size:0}})
db.collection.update({}, { $set : {'myArray': [] }} , {multi:true} )