$group two conditions mongodb code example
Example: condition after $group mongodb
db.books.aggregate([
{ $group : { _id : "$author", books: { $push: "$title" } } }
])
db.books.aggregate([
{ $group : { _id : "$author", books: { $push: "$title" } } }
])