public class UnwindOperation extends Object implements AggregationOperation, FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
$unwind-operation.
We recommend to use the static factory method Aggregation.unwind(String) instead of creating instances of
this class directly.
| Modifier and Type | Class and Description |
|---|---|
static interface |
UnwindOperation.EmptyArraysBuilder |
static interface |
UnwindOperation.IndexBuilder |
static interface |
UnwindOperation.PathBuilder |
static class |
UnwindOperation.UnwindOperationBuilder
Builder for fluent
UnwindOperation creation. |
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation| Constructor and Description |
|---|
UnwindOperation(Field field)
Creates a new
UnwindOperation for the given Field. |
UnwindOperation(Field field,
boolean preserveNullAndEmptyArrays)
Creates a new
UnwindOperation using Mongo 3.2 syntax. |
UnwindOperation(Field field,
Field arrayIndex,
boolean preserveNullAndEmptyArrays)
Creates a new
UnwindOperation using Mongo 3.2 syntax. |
| Modifier and Type | Method and Description |
|---|---|
ExposedFields |
getFields()
Returns the fields exposed by the
AggregationOperation. |
static UnwindOperation.PathBuilder |
newUnwind()
Get a builder that allows creation of
LookupOperation. |
com.mongodb.DBObject |
toDBObject(AggregationOperationContext context)
|
public UnwindOperation(Field field)
UnwindOperation for the given Field.field - must not be null.public UnwindOperation(Field field, boolean preserveNullAndEmptyArrays)
UnwindOperation using Mongo 3.2 syntax.field - must not be null.preserveNullAndEmptyArrays - true to output the document if path is null, missing or
array is empty.public UnwindOperation(Field field, Field arrayIndex, boolean preserveNullAndEmptyArrays)
UnwindOperation using Mongo 3.2 syntax.field - must not be null.arrayIndex - optional field name to expose the field array index, must not be null.preserveNullAndEmptyArrays - true to output the document if path is null, missing or
array is empty.public com.mongodb.DBObject toDBObject(AggregationOperationContext context)
AggregationOperationtoDBObject in interface AggregationOperationpublic ExposedFields getFields()
FieldsExposingAggregationOperationAggregationOperation.getFields in interface FieldsExposingAggregationOperationpublic static UnwindOperation.PathBuilder newUnwind()
LookupOperation.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.