Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregationAbstractPipeline

AbstractPipeline

abstract class AbstractPipeline<Output : Any>(val context: , val chain: PipelineChainLink) : Pipeline<Output> 

Helper class to implement Pipeline.

Notes for implementors

When implementing a new type of pipeline, the main requirement is to override the return tpe of all existing stage methods to return the same type as the current instance. This sadly has to be done manually because Kotlin doesn't have self-types.

When overriding the stage methods, avoid doing anything other than down-casting the resulting pipeline.

You will also need to implement withStage. Note how creating an instance of AbstractPipeline requires passing a PipelineChainLink. PipelineChainLink implements all complex methods from Pipeline for you.

Constructors

AbstractPipeline

constructor(context: , chain: PipelineChainLink)

Properties

chain

Internal representation of the pipeline state.

context

open override val context: 

The context used to generate this pipeline.

Functions

reinterpret

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

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

toString

override fun toString(): String

JSON representation of this pipeline.

withStage

abstract override fun withStage(stage: BsonNode): Pipeline<Output>

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

writeTo

override fun writeTo(writer: )

Writes the entire pipeline into writer.