object_keys(value: object) -> array of string

Get an array of top-level keys from an object type field (field names from JSON objects).

See also flatten, flatten_all, flatten_leaves, flatten_single.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

make_col keys:object_keys(foo)

Given this JSON object in column foo:

foo
{"a":{"aa":1},"b":{"bb":2}}

object_keys produces:

keys
["a", "b"]

It extracts the top level JSON object key names to produce an array in the new column. Column foo will be retained.