bag_keys()

Enumerates all the root keys in a dynamic property-bag object.

Syntax

bag_keys(dynamic object)

Returns

An array of keys, order is undetermined.

Examples

datatable(index:long, d:dynamic) [
1, dynamic({'a':'b', 'c':123}), 
2, dynamic({'a':'b', 'c':{'d':123}}),
3, dynamic({'a':'b', 'c':[{'d':123}]}),
4, dynamic(null),
5, dynamic({}),
6, dynamic('a'),
7, dynamic([])]
| extend keys = bag_keys(d)
index d keys
1 {
"a": "b",
"c": 123
}
[
"a",
"c"
]
2 {
"a": "b",
"c": {
"d": 123
}
}
[
"a",
"c"
]
3 {
"a": "b",
"c": [
{
"d": 123
}
]
}
[
"a",
"c"
]
4
5 {} []
6 a
7 []