Skip to main content

getLong (Function)

Function retrieves the long value specified in the given path of the JSON element.

Syntax

<LONG> json:getLong(<STRING|OBJECT> json, <STRING> path)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
jsonThe JSON input containing long value.STRING OBJECTNoYes
pathThe JSON path to fetch the long value.STRINGNoYes

Example 1

json:getLong(json,'$.age')

If the json is the format {'name' : 'John', 'age' : 23}, the function returns 23 as there is a matching long at $.age.

Example 2

json:getLong(json,'$.salary')

If the json is the format {'name' : 'John', 'age' : 23}, the function returns null as there are no matching element at $.salary.

Example 3

json:getLong(json,'$.name')

If the json is the format {'name' : 'John', 'age' : 23}, the function returns null as there are no matching long at $.name.