UnionWith class

$unionWith aggregation stage

Stage description

New in version 4.4.

Performs a union of two collections. $unionWith combines pipeline results from two collections into a single result set. The stage outputs the combined result set (including duplicates) to the next stage.

The order in which the combined result set documents are output is unspecified.

Examples:

Dart code:

UnionWith(
  coll: 'warehouses',
  pipeline: [
    Project({
      'state': 1,
      '_id': 0
    })
  ],
).build()

Equivalent mongoDB aggregation stage:

{
  $unionWith: {
     coll: "warehouses",
     pipeline: [
       { $project:
         { state: 1, _id: 0 }
       }
     ]
  }
}

https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/

Inheritance

Constructors

UnionWith({required String coll, List<AggregationStage>? pipeline})
Creates $UnionWith stage with it's own pipeline

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() Map<String, Object>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited