mongodb find array size gt code example
Example 1: query document array size greater than 1
// Find all docs that have at least two name array elements.
db.accommodations.find({'name.1': {$exists: true}})
Example 2: mongodb filter empty array
db.collection.find({arrayElementName : {$exists:true, $size:0}})