mongodb group if condition 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" } } }
])