Skip to main content

$parseToString

The $parseToString operator converts any value to its string representation.

Input

  • A single value of any type

Output

  • The string representation of the input value

Examples

Convert Number to String

{
  "$parseToString": [
    123
  ]
}
Result: "123"

Convert Boolean to String

{
  "$parseToString": [
    true
  ]
}
Result: "true"

Convert Null to String

{
  "$parseToString": [
    null
  ]
}
Result: "null"

Field Value

{
  "$parseToString": [
    {
      "$input": "value"
    }
  ]
}
Result: The string representation of the value field