title: How to create an Aggregation from a list of AggregationOperation in Spring data MongoDB?
body: <p>I want to create an Aggregation that can be used in MongoOperations's aggregate() function.
  So for creating the Aggregation, I used a list of AggregationOperation as follows:</p>
  
  <pre><code>    ApplicationContext ctx = new AnnotationConfigApplicationContext(MongoConfig.class);
      MongoOperations mongoOperation = (MongoOperations) ctx.getBean("mongoTemplate"); 
  
      List&lt;AggregationOperation&gt; aggregationOperations = new ArrayList&lt;AggregationOperation&gt;();
      aggregationOperations.add(new MatchOperation(Criteria.where("country").is("tigo")));
      aggregationOperations.add(new UnwindOperation(Fields.field("myDetails")));
      aggregationOperations.add(new MatchOperation(Criteria.where("myDetails.type").is("health")));
      aggregationOperations.add(new SortOperation(new Sort(Sort.Direction.ASC, "myDetails.datetime")));
      AggregationResults&lt;AggregateFactoryResult&gt; result = mongoOperation.aggregate(new Aggregation(aggregationOperations), "gui_data", AggregateFactoryResult.class);
  </code></pre>
  
  <p>But doing this, i am getting a compile time error at the last line as follows:</p>
  
  <blockquote>
    <p>The constructor Aggregation(List) is not 
     visible</p>
  </blockquote>
  
  <p>The reason is that because the Aggregation(List) constructor is having protected access.
  Is there any i can pass my list of AggregationOperation to create an aggregation?
  Any suggestion?</p>