Package org.mongojack

Class Aggregation<T>

  • Type Parameters:
    T - The type of results to be produced by the aggregation results.

    public class Aggregation<T>
    extends Object
    Use com.mongodb.client.model.Aggregates
    A Generic Aggregation object that allows the aggregation operations, and the return type of the AggregationResult to be specified.

    The Pipeline is a List<Stage>, and Stage is a Bson which makes it compatible with the methods in the JacksonMongoCollection that accept Bson-list aggregate pipeline objects, and makes those methods interoperable with Mongo's internal Aggregates class. But be warned that Pipeline.initialize has to be called before Stage.toBsonDocument, or exceptions will result; similarly the list operations shouldn't be called before initialize is called. JacksonMongoCollection takes care of calling initialize for you.

    Christopher Exell