bag_keys()bag_keys()

枚举动态属性包对象中的所有根密钥。Enumerates all the root keys in a dynamic property-bag object.

语法Syntax

bag_keys(动态对象)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)
indexindex dd 密钥keys
11 {{
"a": "b","a": "b",
"c":123"c": 123
}}
[[
"a","a",
"c""c"
]]
22 {{
"a": "b","a": "b",
"c": {"c": {
"d":123"d": 123
}}
}}
[[
"a","a",
"c""c"
]]
33 {{
"a": "b","a": "b",
"c": ["c": [
{{
"d":123"d": 123
}}
]]
}}
[[
"a","a",
"c""c"
]]
44
55 {} [][]
66 aa
77 [][]