JSONExtract Function
JSONExtract in the Data Source
By default, the application will extract JSON in-memory. The system administrator can enable JSON extraction in the database, for those Data Sources that support it, by changing a system configuration setting. Each Data Source implements this function differently, so care should be taken when enabling this feature.
Table A below lists the supported JSONPath expressions for in-memory processing and processing in the supported Data Source types.
JSONPath Feature | In-Memory | MySQL | Oracle | SQL Server 2016+ |
---|---|---|---|---|
$ | Yes | Yes | No | No |
$.prop | Yes | Yes | Yes | Yes |
$.prop[0] | Yes | Yes | Yes | Yes |
$[1,2] | Yes | No | No | No |
$..recursive | Yes | No | No | No |
$.prop.* | Yes | Yes | No | No |
$[*] | Yes | Yes | No | No |
$[3:5] | Yes | No | No | No |
$[6:] | Yes | No | No | No |
$[:3] | Yes | No | No | No |
$[-2:] | Yes | No | No | No |
$[?(@.prop == val)] | No | No | No | No |
$[?(@.prop != val)] | No | No | No | No |
$[?(@.prop > val)] | No | No | No | No |
$[?(@.prop < val)] | No | No | No | No |
$[?(@.prop >= val)] | No | No | No | No |
$[?(@.prop <= val)] | No | No | No | No |
$[?(@.prop =~ val)] | No | No | No | No |
$[?(!@.prop =~ val)] | No | No | No | No |
$[?(@.prop == val && @.prop == val)] | No | No | No | No |
$[?(@.prop == val || @.prop == val)] | No | No | No | No |
$[?(@.prop in ['1', '2', '3'])] | No | No | No | No |
$[?(@.prop nin ['1', '2', '3'])] | No | No | No | No |
Notes and Exceptions
- IBM DB2 — testing has shown this data source does not support JSONExtract although its documentation says that it does
- PostgreSQL — no support for JSONPath syntax, so JSONExtract can only be done in-memory
- Oracle — if the JSONPath expression selects a JSON object from within the main JSON object, the return value will be null