public class AggregationProjectFields extends Object
$project
pipeline operator.Constructor and Description |
---|
AggregationProjectFields(boolean includeId,
String... fields)
Creates a new AggregationProjectFields.
|
AggregationProjectFields(String... fields)
Creates a new AggregationProjectFields.
|
Modifier and Type | Method and Description |
---|---|
static AggregationProjectFields |
include(String... fields)
Helper method to create a
AggregationProjectFields that
implicitly includes the _id field. |
static AggregationProjectFields |
includeWithoutId(String... fields)
Helper method to create a
AggregationProjectFields that does not
include the _id field. |
List<IntegerElement> |
toElements()
Returns the elements describing the fields to be included (and if the _id
should be excluded).
|
public AggregationProjectFields(boolean includeId, String... fields)
includeId
- If false then the _id field will be excluded from the fields
in the results of the $project operation.fields
- The fields to include in the results of the $project
operation.public AggregationProjectFields(String... fields)
fields
- The fields to include in the results of the $project
operation.public static AggregationProjectFields include(String... fields)
AggregationProjectFields
that
implicitly includes the _id field.fields
- The fields to be included.AggregationProjectFields
.public static AggregationProjectFields includeWithoutId(String... fields)
AggregationProjectFields
that does not
include the _id field.fields
- The fields to be included.AggregationProjectFields
.public List<IntegerElement> toElements()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.