Skip to content

HasUnionWithCompatibility

Pipeline that can be used as the second argument in a $unionWith stage.

Instances of this interface should be immutable.

Inheritors

Properties

context

@LowLevelApi



abstract val context: BsonContext

The context used to generate this pipeline.

Functions

embedInUnionWith

@LowLevelApi



abstract fun embedInUnionWith(writer: BsonFieldWriter)

Writes this pipeline into a $unionWith stage.

This method is a low-level API for building custom $unionWith stages. Regular users should use HasUnionWith.unionWith instead.

Implementation contract

When another pipeline wants to embed the current pipeline into itself, it will call this method from within the $unionWith stage. This method should thus emit the body of the stage:

{
    coll: "<collection>",
    pipeline: [ <stage1>, ]
}
External resources

See also

reinterpret

@DangerousMongoApi



@LowLevelApi



abstract fun <New : Any> reinterpret(): Pipeline<New>

Changes the type of the returned document, with no type-safety.

toString

abstract override fun toString(): String

JSON representation of this pipeline.

withStage

@DangerousMongoApi



@LowLevelApi



abstract fun withStage(stage: BsonNode): Pipeline<Document>

Creates a new pipeline that expands on the current one by adding stage.

writeTo

@LowLevelApi



abstract fun writeTo(writer: BsonValueWriter)

Writes the entire pipeline into writer.