Filters the keys and values from an Object data type column based on a specified key value. |
Object literal reference example:
derive type:single value:FILTEROBJECT('{"q":"hello","r","there":"q","world"}', 'q') as:'q' |
Output: Generates a new q
column containing an Object of key-value pairs for the q
key:
{"q":["hello", "world"]} |
derive type:single value:FILTEROBJECT(obj,'keys') |
Argument | Required? | Data Type | Description |
---|---|---|---|
obj | Y | Object | Function returning an Object or Object literal to be filtered |
keys | Y | Array | Array representing the keys to filter. Each element can be a String, function returning a String, or a reference to a column of String values. |
Object literal or function returning an Object whose keys you want to extract into an array.
Required? | Data Type | Example Value |
---|---|---|
Yes | Object literal or function | myObj
|
This parameter contains an Array of Strings, each of which represents a key whose values are to be returned with the key as the output of the function.
Required? | Data Type | Example Value |
---|---|---|
Yes | String or Array | ['key1','key2','key3']
|