Function
Arg | Description | Type |
---|---|---|
item | Any |
Iterate over dict members producing _key and _value columns
This can be used to filter dict items by feeding the results to
to_dict()
Plugin
Arg | Description | Type |
---|---|---|
item | The item to enumerate. | Any |
Enumerate all members of the item (similar to Python’s items() method).
This plugin allows iteration over dicts or queries.
If the item is a dict, then this plugin will iterate over its keys and values producing two columns:
_key
column is the dictionary key_value
column is the dictionary valueFor queries or arrays, the items()
plugin will produce two columns:
_key
column is the row index starting from 0_value
column is the row itself as a dict.The items()
query is useful to treat the results of another
query as a dict instead of a row. This is useful when the query
produces unpredictable columns or you need to operate over the
column names somehow.
SELECT * FROM items(item={ SELECT * FROM info() })
Produces:
[
{
"_key": 0,
"_value": {
"Hostname": "DESKTOP-BTI2T9T",
"Uptime": 20445,
"BootTime": 1641029930,
"Architecture": "amd64"
}
}
]