public class ReplaceWithOperation extends ReplaceRootOperation
$replaceRoot-operation. id field with @{code $replaceWith}. This way it is
possible to promote an embedded document to the top-level or specify a new document.ReplaceRootOperation.Replacement, ReplaceRootOperation.ReplaceRootDocumentOperation, ReplaceRootOperation.ReplaceRootDocumentOperationBuilder, ReplaceRootOperation.ReplaceRootOperationBuilderFieldsExposingAggregationOperation.InheritsFieldsAggregationOperation| Constructor and Description |
|---|
ReplaceWithOperation(ReplaceRootOperation.Replacement replacement)
Creates new instance of
ReplaceWithOperation. |
| Modifier and Type | Method and Description |
|---|---|
static ReplaceWithOperation |
replaceWithValue(Object value)
Creates new instance of
ReplaceWithOperation. |
static ReplaceWithOperation |
replaceWithValueOf(Object value)
|
org.bson.Document |
toDocument(AggregationOperationContext context)
|
builder, getFields, getOperator, getReplacementclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinheritsFieldstoPipelineStagespublic ReplaceWithOperation(ReplaceRootOperation.Replacement replacement)
ReplaceWithOperation.replacement - must not be null.public static ReplaceWithOperation replaceWithValue(Object value)
ReplaceWithOperation.value - must not be null.ReplaceWithOperation.public static ReplaceWithOperation replaceWithValueOf(Object value)
value - must not be null.ReplaceWithOperation.public org.bson.Document toDocument(AggregationOperationContext context)
AggregationOperationtoDocument in interface AggregationOperationtoDocument in class ReplaceRootOperationcontext - the AggregationOperationContext to operate within. Must not be null.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.