Table of Contents

Method UnionWith

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

UnionWith<TInput, TWith, TOutput>(PipelineDefinition<TInput, TOutput>, IMongoCollection<TWith>, PipelineDefinition<TWith, TOutput>)

Appends a $unionWith stage to the pipeline.

public static PipelineDefinition<TInput, TOutput> UnionWith<TInput, TWith, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, IMongoCollection<TWith> withCollection, PipelineDefinition<TWith, TOutput> withPipeline = null)

Parameters

pipeline PipelineDefinition<TInput, TOutput>

The pipeline.

withCollection IMongoCollection<TWith>

The with collection.

withPipeline PipelineDefinition<TWith, TOutput>

The with pipeline.

Returns

PipelineDefinition<TInput, TOutput>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the input documents.

TWith

The type of the with collection documents.

TOutput

The type of the output documents.