I have a mongodb aggregation $reduce pipleine that is not working as expected. This is what I am trying to achieve.
$reduce
Basically I am trying to get the obje