$$CURRENT

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

Reference group: Utility expressions and variables

What it does

References current document context; it often starts equal to $$ROOT but can change in scoped expressions.

Syntax

$$CURRENT

Use case

Understand expression scope.

$$CURRENT: practical example
{ $project: { currentId: "$$CURRENT._id" } }
💡 Explanation References current document context; it often starts equal to $$ROOT but can change in scoped expressions. When to use it Understand expression scope.
Key Takeaways
  • References current document context; it often starts equal to $$ROOT but can change in scoped expressions.
  • Typical use: Understand expression scope.