$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 }
Raises a number to the specified exponent.
{ "$pow": [ <baseExpression>, <exponentExpression> ] }
{ "radius": 3 }
{ "$project": { "areaFactor": { "$pow": ["$radius", 2] } } }
{ "areaFactor": 9 }