website logo
⌘K
🏠Homepage
👋Introduction
Key Concepts & Architecture
🚀Getting Started
👨‍💻SQL Reference
SQL Queries
SQL Clauses
SQL Data Types
SQL Functions
Schema
🚨Error Handling
🆚Differences Between Oxla vs. PostgreSQL
Docs powered by archbee 

JSON Functions

2min

To help you query JSON data, Oxla provides some functions that will be used to operate and manipulate the JSON data. The functions are as follows:

Functions

Description

JSON_EXTRACT_PATH()

It extracts JSON sub-object at the specified path.

JSON_EXTRACT_PATH_TEXT()

It returns text referenced by a series of path elements in a JSON string or JSON body.

JSON_ARRAY_LENGTH()

It returns the number of elements in the outer array of a JSON string or JSON body.

JSON_ARRAY_EXTRACT()

It returns the JSON array as a set of JSON values. 

Operators are used to specify conditions when using JSON functions. Oxla also supports JSON operators as listed below:

Operators

Description

Example

->

It gets & returns the element of the JSON array.

'[{"a":"cab"},{"b":"bac"},{"c":"abc"}]'::json -> 2

->

It gets & returns the JSON object field.

'{"a": {"b":"abc"}}'::json -> 'a'

->>

It gets & returns the element of the JSON array as text.

'[11,22,33]'::json ->> 2

->>

It gets & returns the JSON object field as text.

'{"a":13,"b":33}'::json ->> 'b'



Updated 11 May 2023
Did this page help you?
Yes
No
PREVIOUS
Boolean Function
NEXT
JSON_EXTRACT_PATH
Docs powered by archbee 

Dedicated to data analytics that provides 10x faster execution of analytical queries than current state of the art solutions. We are launching SOON! Join the waiting list for more info.




©2022 Oxla