This function package exposes common json functions.
Check if the key/JSONPath is present in the json object. Refer https://github.com/oliveagle/jsonpath for expression format.
Arg |
Type |
Description |
object |
any |
The json object |
key |
string |
The key or JSONPath to check |
Arg |
Type |
Description |
returnVal |
bool |
True if value is associated with the key / JSONPath |
Get value of associated key from json object
Arg |
Type |
Description |
object |
any |
The json object |
key |
string |
The key for which the value to get |
Arg |
Type |
Description |
returnVal |
any |
The value associated with the key |
Get the number of top level elements in json object or array
Arg |
Type |
Description |
jsonObjectOrArray |
any |
The json object or array |
Arg |
Type |
Description |
lengthInteger |
int |
The top level items in the json object |
Convert every number type to string in a json object or array
Arg |
Type |
Description |
jsonObjectOrArray |
any |
The json object or array |
Arg |
Type |
Description |
jsonObjectOrArray |
any |
The json object or array with numbers encoded as strings |
Get the list of all top level keys of json object
Arg |
Type |
Description |
object |
any |
The json object |
Arg |
Type |
Description |
arrayOfStrings |
array |
The list of top level keys |
Get the list of all top level values of json object
Arg |
Type |
Description |
object |
any |
The json object |
Arg |
Type |
Description |
arrayOfValues |
array |
The list of all top level values in json object |
Apply a JSON path to an object.
Arg |
Type |
Description |
path |
string |
The JSON path |
object |
any |
The object to apply the JSON path to |
Arg |
Type |
Description |
returnVal |
any |
The result of the JSON path |
Set the value of existing key or add new key and set it's value in a json object
Arg |
Type |
Description |
object |
any |
The json object |
key |
string |
The key for value |
value |
any |
The value for key |
Arg |
Type |
Description |
jsonObject |
any |
The updated json object |
Process the JSON inputs based on a provided query and return the filtered output
Arg |
Type |
Description |
object |
any |
The json object |
query |
string |
Query to perform |
Arg |
Type |
Description |
output |
array |
result of the jq filter |