public static class ObjectOperators.MergeObjects extends Object
AggregationExpression
for $mergeObjects
that combines multiple documents into a single document.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractAggregationExpression.Expand
Expand a nested list of values to single entries or keep the list.
|
Modifier and Type | Method and Description |
---|---|
protected List<Object> |
append(Object value) |
protected List<Object> |
append(Object value,
AbstractAggregationExpression.Expand expandList) |
protected Map<String,Object> |
append(String key,
Object value) |
protected Map<String,Object> |
appendAt(int index,
String key,
Object value)
Append the given key at the position in the underlying
LinkedHashMap . |
protected Map<String,Object> |
argumentMap()
Get the argument map.
|
protected static List<Field> |
asFields(String... fieldRefs) |
protected boolean |
contains(Object key)
Check if the given key is available.
|
protected <T> T |
get(int index)
Get the value at a given index.
|
protected <T> T |
get(Object key)
Get the value for a given key.
|
protected String |
getMongoMethod() |
static ObjectOperators.MergeObjects |
merge(Object... values)
Creates new
aggregation expression that takes given values and combines them into a single
document. |
static ObjectOperators.MergeObjects |
mergeValuesOf(AggregationExpression... expressions)
Creates new
aggregation expression that takes the result of the given expressions and combines them into a single document. |
static ObjectOperators.MergeObjects |
mergeValuesOf(String... fieldReferences)
Creates new
aggregation expression that takes the given field references and
combines them into a single document. |
ObjectOperators.MergeObjects |
mergeWith(Object... values)
Creates new
aggregation expression by adding the given values (documents or mapped objects). |
ObjectOperators.MergeObjects |
mergeWithValuesOf(AggregationExpression... expression)
Creates new
aggregation expression by adding the given expressions . |
ObjectOperators.MergeObjects |
mergeWithValuesOf(String... fieldReferences)
Creates new
aggregation expression by adding the given field references . |
protected Map<String,Object> |
remove(String key) |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
org.bson.Document |
toDocument(Object value,
AggregationOperationContext context) |
protected List<Object> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
from, toDocument
create, create
public static ObjectOperators.MergeObjects merge(Object... values)
aggregation expression
that takes given values and combines them into a single
document. values
- must not be null.ObjectOperators.MergeObjects
.public static ObjectOperators.MergeObjects mergeValuesOf(String... fieldReferences)
aggregation expression
that takes the given field references
and
combines them into a single document.fieldReferences
- must not be null.ObjectOperators.MergeObjects
.public static ObjectOperators.MergeObjects mergeValuesOf(AggregationExpression... expressions)
aggregation expression
that takes the result of the given expressions
and combines them into a single document.expressions
- must not be null.ObjectOperators.MergeObjects
.public ObjectOperators.MergeObjects mergeWithValuesOf(String... fieldReferences)
aggregation expression
by adding the given field references
.fieldReferences
- must not be null.ObjectOperators.MergeObjects
.public ObjectOperators.MergeObjects mergeWithValuesOf(AggregationExpression... expression)
aggregation expression
by adding the given expressions
.expression
- must not be null.ObjectOperators.MergeObjects
.public ObjectOperators.MergeObjects mergeWith(Object... values)
aggregation expression
by adding the given values (documents or mapped objects).values
- must not be null.ObjectOperators.MergeObjects
.public org.bson.Document toDocument(Object value, AggregationOperationContext context)
protected String getMongoMethod()
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpression
toDocument
in interface AggregationExpression
context
- must not be null.Document
) form of the expression.protected List<Object> append(Object value, AbstractAggregationExpression.Expand expandList)
protected Map<String,Object> appendAt(int index, String key, Object value)
LinkedHashMap
.index
- key
- value
- protected <T> T get(int index)
T
- index
- protected <T> T get(Object key)
T
- key
- protected boolean contains(Object key)
key
- Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.