Skip to main content

$concat

The $concat operator concatenates multiple strings into a single string.

Input

  • An array of string values to concatenate

Output

  • A single string containing all input strings joined together in order

Examples

Basic Concatenation

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

Field Values

{
  "$concat": [
    {
      "$input": "first_name"
    },
    " ",
    {
      "$input": "last_name"
    }
  ]
}
Result: The first_name and last_name fields joined with a space