$sqrt/$pow/$exp/$ln/$log10/$log

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

Reference group: Arithmetic expressions

What it does

Mathematical functions with domain constraints.

Syntax

Example: {$pow: [base, exponent]}

Use case

Statistical transforms.

$sqrt/$pow/$exp/$ln/$log10/$log: practical example
{ $project: { squared: { $pow: ["$score", 2] }, root: { $sqrt: "$variance" } } }
💡 Explanation Mathematical functions with domain constraints. When to use it Statistical transforms.
Key Takeaways
  • Mathematical functions with domain constraints.
  • Typical use: Statistical transforms.