I have a MongoDB collection with documents in the following format:
{ \"_id\" : ObjectId(\"4e8ae86d08101908e1000001\"), \"name\" : [\"Name\"], \"zipcod
You can MongoDB aggregation to do the task:
db.collection.aggregate([ { $addFields: { arrayLength: {$size: '$array'} }, }, { $match: { arrayLength: {$gt: 1} }, }, ])