Skip to main content

$length

The $length operator returns the length of a string.

Input

  • A single string value

Output

  • The number of characters in the input string

Examples

Basic Length

{
  "$length": [
    "Hello, World!"
  ]
}
Result: 13

Empty String

{
  "$length": [
    ""
  ]
}
Result: 0

Field Value

{
  "$length": [
    {
      "$input": "message"
    }
  ]
}
Result: The length of the message field