I have a collection in a MongoDB that contains a field "events" which is an array. I need to write an aggregate query for this that checks for the events array to not be empty, but can't find a way to do this.
I want something like:
db.collection.aggregate([
{
$match: {
events: {
"$empty": false
}
}
}
]);