Skip to main content

$sqrt

The $sqrt operator returns the square root of a number.

Input

  • A single numeric value (must be non-negative)

Output

  • The square root of the input value

Examples

Perfect Square

{
  "$sqrt": [
    16
  ]
}
Result: 4

Non-integer Result

{
  "$sqrt": [
    2
  ]
}
Result: 1.4142135623730951

Field Value

{
  "$sqrt": [
    {
      "$input": "area"
    }
  ]
}
Result: The square root of the area field

Negative Number Error

{
  "$sqrt": [
    -4
  ]
}
Result: Error (cannot take square root of negative number)