Skip to main content

$keys

The $keys operator returns an array of all keys in an object/map.

Input

  • A single object/map value

Output

  • An array containing all the keys of the input object

Examples

Get Keys from Object

{
  "$keys": [
    {
      "name": "Alice",
      "age": 25,
      "city": "New York"
    }
  ]
}
Result: ["name", "age", "city"]

From Field

{
  "$keys": [
    {
      "$input": "user_object"
    }
  ]
}
Result: An array of all keys from the user_object field