unionWith

fun unionWith(collection: MongoCollection<*>, pipeline: List<Bson>): Bson
fun unionWith(collection: MongoCollection<*>, pipeline: List<Bson>): Bson

Creates a $unionWith pipeline stage.

Return

the $unionWith pipeline stage @mongodb.driver.manual reference/operator/aggregation/unionWith/ $unionWith @mongodb.server.release 4.4

Parameters

collection

the collection in the same database to perform the union with.

pipeline

the pipeline to run on the union.