# JSON Functions

- [JSONPath Expressions](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/jsonpath-expressions.md): Understand JSONPath syntax. This guide explains how to use JSONPath to select and extract specific elements, objects, or arrays from JSON documents.
- [Differences between JSON\_QUERY and JSON\_VALUE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/differences-between-json_query-and-json_value.md): Learn the difference between JSON\_QUERY and JSON\_VALUE in MariaDB. JSON\_QUERY returns objects or arrays, while JSON\_VALUE extracts scalar values.
- [JSON\_ARRAY](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_array.md): Create a JSON array. This function evaluates a list of values and returns a JSON array containing those values.
- [JSON\_ARRAY\_APPEND](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_array_append.md): Explore JSON\_ARRAY\_APPEND in MariaDB. This function appends values to the end of specified arrays within a JSON document, returning the modified result.
- [JSON\_ARRAY\_INSERT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_array_insert.md): This function inserts values into a JSON document at a specified path, returning the modified document, and supports evaluating multiple path-value pairs sequentially.
- [JSON\_ARRAY\_INTERSECT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_array_intersect.md): Available from version 11.2, this function compares two JSON arrays and returns a new array containing only the items present in both.
- [JSON\_COMPACT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_compact.md): Learn about the JSON\_COMPACT function in MariaDB. This function removes all unnecessary whitespace from a JSON document, minimizing its size for efficient storage and transmission.
- [JSON\_CONTAINS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_contains.md): Check for JSON containment. This function returns 1 if a candidate JSON document is contained within a target JSON document, or 0 otherwise.
- [JSON\_CONTAINS\_PATH](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_contains_path.md): Check for a JSON path. This function returns 1 if a specified path exists within a JSON document, or 0 if it does not.
- [JSON\_DEPTH](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_depth.md): Discover JSON\_DEPTH in MariaDB. This function returns the maximum depth of a JSON document, assigning a depth of 1 to scalars and empty structures, and higher values for nested data.
- [JSON\_DETAILED](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_detailed.md): Explore JSON\_DETAILED in MariaDB. Also known as JSON\_PRETTY, this function formats JSON documents with indentation and newlines to emphasize nested structures for readability.
- [JSON\_EQUALS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_equals.md): Discover JSON\_EQUALS in MariaDB. This function checks for equality between two JSON objects, returning 1 if they are equal, 0 if not, handling key order and data types intelligently.
- [JSON\_EXISTS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_exists.md): Explore JSON\_EXISTS in MariaDB. This function checks whether a specified JSON document contains an element at a given path, returning 1 for existence and 0 otherwise.
- [JSON\_EXTRACT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_extract.md): Complete JSON\_EXTRACT() reference: JSON\_EXTRACT(json\_doc, path\[, path]...) syntax, JSONPath arguments, NULL/error behavior, and multi-match array autowrap.
- [JSON\_INSERT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_insert.md): Learn about the JSON\_INSERT function in MariaDB. This function inserts new data into a JSON document without replacing existing values, returning the updated document or NULL.
- [JSON\_KEY\_VALUE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_key_value.md): Explore JSON\_KEY\_VALUE in MariaDB. Available from version 11.2, this function extracts key/value pairs from a JSON object, enabling easier data transformation and usage with JSON\_TABLE.
- [JSON\_KEYS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_keys.md): Return keys from a JSON object. This function returns the keys from the top-level value of a JSON object as a JSON array.
- [JSON\_LENGTH](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_length.md): Return the length of a JSON document. This function returns the length of a JSON document or, if a path is given, the length of the value within the path.
- [JSON\_LOOSE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_loose.md): Discover JSON\_LOOSE in MariaDB. This function adds spaces to a JSON document to improve its readability, providing a format that is easier for humans to scan than compact JSON.
- [JSON\_MERGE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_merge.md): Merge JSON documents. This function merges two or more JSON documents into a single JSON document, preserving all keys and values.
- [JSON\_MERGE\_PATCH](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_merge_patch.md): Learn about JSON\_MERGE\_PATCH in MariaDB. This RFC 7396-compliant function merges JSON documents by overwriting duplicate keys, serving as a modern replacement for the deprecated JSON\_MERGE.
- [JSON\_MERGE\_PRESERVE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_merge_preserve.md): Explore JSON\_MERGE\_PRESERVE in MariaDB. This function merges JSON documents while keeping all members, including those with duplicate keys, effectively acting as a synonym for the legacy JSON\_MERGE.
- [JSON\_NORMALIZE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_normalize.md): Discover JSON\_NORMALIZE in MariaDB. This function recursively sorts keys and removes spaces from a JSON document, enabling reliable equality comparisons and unique constraints on JSON data.
- [JSON\_OBJECT](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_object.md): Create a JSON object. This function evaluates a list of key-value pairs and returns a JSON object containing those pairs.
- [JSON\_OBJECT\_FILTER\_KEYS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_object_filter_keys.md): Discover JSON\_OBJECT\_FILTER\_KEYS in MariaDB. Available from version 11.2, this function returns a new JSON object containing only the key-value pairs where the keys match those provided in a specified
- [JSON\_OBJECT\_TO\_ARRAY](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_object_to_array.md): Explore JSON\_OBJECT\_TO\_ARRAY in MariaDB. Available from version 11.2, this function converts JSON objects into arrays of key-value pairs, facilitating operations like finding common values when used w
- [JSON\_OVERLAPS](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_overlaps.md): Discover JSON\_OVERLAPS in MariaDB. Available from version 10.9, this function compares two JSON documents, returning true if they share at least one common key-value pair, array element, or scalar val
- [JSON\_PRETTY](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_pretty.md): Learn about JSON\_PRETTY in MariaDB. This function is an alias for JSON\_DETAILED, serving to format JSON documents in a human-readable way by adding indentation and newlines.
- [JSON\_QUERY](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_query.md): Extract a JSON object or array. This function extracts data from a JSON document at a given path, returning a JSON object or array.
- [JSON\_QUOTE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_quote.md): Quote a string as a JSON value. This function wraps a string with double quotes and escapes special characters to create a valid JSON string literal.
- [JSON\_REMOVE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_remove.md): Remove data from a JSON document. This function removes data from a JSON document at a specified path and returns the result.
- [JSON\_REPLACE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_replace.md): Replace values in a JSON document. This function replaces existing values in a JSON document and returns the result.
- [JSON\_SCHEMA\_VALID](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_schema_valid.md): Discover JSON\_SCHEMA\_VALID in MariaDB. Available from version 11.1, this function validates a JSON document against a specified JSON Schema (Draft 2020), returning true if valid.
- [JSON\_SEARCH](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_search.md): Search for a value in a JSON document. This function returns the path to the given string within a JSON document.
- [JSON\_SET](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_set.md): Insert or update data in a JSON document. This function inserts or updates data in a JSON document at a specified path and returns the result.
- [JSON\_TABLE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_table.md): Convert JSON data to a relational table. This table function extracts data from a JSON document and returns it as a relational table with columns.
- [JSON\_TYPE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_type.md): Return the type of a JSON value. This function returns a string indicating the type of a JSON value (e.g., OBJECT, ARRAY, INTEGER).
- [JSON\_UNQUOTE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_unquote.md): Unquote a JSON value. This function removes the quotes from a JSON string and unescapes special characters.
- [JSON\_VALID](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_valid.md): Check if a value is valid JSON. This function returns 1 if the argument is a valid JSON document, and 0 otherwise.
- [JSON\_VALUE](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_value.md): Extract a scalar value from a JSON document. This function extracts a value from a JSON document at a given path and returns it as a scalar.
- [JSON Validation Function](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json-validation-function.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
