Skip to content

$pow

Raises a number to the specified exponent.

Syntax

{ "$pow": [ <baseExpression>, <exponentExpression> ] }

Example

Input

{ "radius": 3 }

Stage

{ "$project": { "areaFactor": { "$pow": ["$radius", 2] } } }

Output

{ "areaFactor": 9 }