Aggregation pipeline properly working with groupBy and unwind