mongodb conditional group output 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" } } }
])