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 . |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inheritsFields
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 org.bson.Document toDocument(AggregationOperationContext context)
AggregationOperation
toDocument
in interface AggregationOperation
public ExposedFields getFields()
FieldsExposingAggregationOperation
AggregationOperation
.getFields
in interface FieldsExposingAggregationOperation
public static UnwindOperation.PathBuilder newUnwind()
LookupOperation
.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.