$out

Reference type:Cheat sheetFormat:Syntax + example + use case

Reference group: Pipeline stages

What it does

Writes results to a collection, replacing its contents according to $out semantics.

Syntax

{$out: "collectionName"}

Use case

Build a report collection.

Important notes

Understand replacement behavior.

$out: practical example
{ $out: "monthlyReport" }
💡 Explanation Writes results to a collection, replacing its contents according to $out semantics. When to use it Build a report collection. Caution Understand replacement behavior.
Key Takeaways
  • Writes results to a collection, replacing its contents according to $out semantics.
  • Typical use: Build a report collection.