title: spring mongodb aggregation sum counting
body: <p>i am new to mongodb with spring boot. What i want is that how can i handle total count. </p>
  
  <p>here is my spring code</p>
  
  <pre><code>Criteria creteria =Criteria.where("name").is("james"));
  MatchOperation matchStage = Aggregation.match(creteria);
  GroupOperation group = group("userId").count().as("totalCnt");
  
  
  Aggregation aggregation = Aggregation.newAggregation(matchStage, group );
  
  AggregationResults&lt;Map&gt; list= mongoTemplate.aggregate(aggregation,"listCollection", Map.class);
  
  
  
  for(Map map:list){
  
      System.out.println("list :"+list);
  }
  ===result===
  list :{_id=111, totalCnt=1}
  list :{_id=222, totalCnt=41}
  list :{_id=333, totalCnt=41}
  </code></pre>
  
  <p>I want to calculate total count:83. How can i fix my code to get sum data.
  Please give me some hint.</p>