Interface Aggregation<T>

Type Parameters:
T - The initial type of the aggregation. Used for collection name resolution.
All Superinterfaces:
AutoCloseable, Iterable<T>

public interface Aggregation<T> extends AutoCloseable, Iterable<T>
Since:
2.0
  • Method Details

    • pipeline

      Aggregation<T> pipeline(Stage... stages)
      Appends the stages to this aggregation's pipeline.
      Parameters:
      stages - the stages to add
      Returns:
      this
      Since:
      3.0
    • pipeline

      default Aggregation<T> pipeline(List<Stage> stages)
      Appends the stages to this aggregation's pipeline.
      Parameters:
      stages - the stages to add
      Returns:
      this
      Since:
      3.0
    • iterator

      MorphiaCursor<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • toList

      default List<T> toList()
      Executes the aggregation pipeline and collects all results into a list.
      Returns:
      a list containing all results of the aggregation