Skip to main content

$toString

The $toString operator converts a value to a string.

Input

  • A single value of any type

Output

  • The string representation of the input value

Examples

Convert Number to String

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

Convert Boolean to String

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

From Field

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