Skip to main content

One doc tagged with "out"

View All Tags

$out

The $out operator is used in a MongoDB aggregation pipeline to write the result of the aggregation to a specified collection. The $out stage must be the last stage in the pipeline, and it effectively replaces the existing collection with the new one containing the aggregated results. If the specified collection does not exist, MongoDB will create it.