Filters the keys and values from an Object data type column based on a specified key value. |
Object literal reference example:
filterobject('{"q":"hello","r","there":"q","world"}', 'q') |
Output: Returns an Object of key-value pairs for the q
key:
{"q":["hello", "world"]} |
Column reference example:
filterobject(myObjects, '[k1,k2]') |
Output: Returns an Object of key-value pairs for all instances of the k1
and k2
keys.
filterobject(obj,'keys') |
Argument | Required? | Data Type | Description |
---|---|---|---|
obj_col | Y | String or Object | Name of column, 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, name of the Object column, or function returning an Object whose keys you want to extract into an array.
Required? | Data Type | Example Value |
---|---|---|
Yes | Object literal, function, or column reference | 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']
|