Du brauchst eine vorgeschaltete $match-Stufe in deiner Pipeline, um nur diejenigen Dokumente auszuwählen, bei denen „action“ ungleich „wait“ ist.
db.collection.aggregate([
{ "$match": { "action": { "$ne": "wait" } } },
{ "$group": {
"_id": "$user.name",
"actions": { "$push": "$action" },
"total": { "$sum": 1 }
} }
])