public final class Aggregates extends Object
Modifier and Type | Method and Description |
---|---|
static <TExpression> |
group(TExpression id,
BsonField... fieldAccumulators)
Creates a $group pipeline stage for the specified filter
|
static <TExpression> |
group(TExpression id,
List<BsonField> fieldAccumulators)
Creates a $group pipeline stage for the specified filter
|
static Bson |
limit(int limit)
Creates a $limit pipeline stage for the specified filter
|
static Bson |
match(Bson filter)
Creates a $match pipeline stage for the specified filter
|
static Bson |
out(String collectionName)
Creates a $out pipeline stage for the specified filter
|
static Bson |
project(Bson projection)
Creates a $project pipeline stage for the specified projection
|
static Bson |
skip(int skip)
Creates a $skip pipeline stage
|
static Bson |
sort(Bson sort)
Creates a $sort pipeline stage for the specified sort specification
|
static Bson |
unwind(String fieldName)
Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a
'$' sign. |
public static Bson match(Bson filter)
public static Bson project(Bson projection)
projection
- the projectionProjections
public static Bson sort(Bson sort)
public static Bson skip(int skip)
skip
- the number of documents to skippublic static Bson limit(int limit)
limit
- the limitpublic static <TExpression> Bson group(TExpression id, BsonField... fieldAccumulators)
TExpression
- the expression typeid
- the id expression for the groupfieldAccumulators
- zero or more field accumulator pairspublic static <TExpression> Bson group(TExpression id, List<BsonField> fieldAccumulators)
TExpression
- the expression typeid
- the id expression for the groupfieldAccumulators
- zero or more field accumulator pairspublic static Bson unwind(String fieldName)
'$'
sign.fieldName
- the field name, prefixed by a '$' sign