Menu

MariaDB JSON Functions Reference

Browse individual reference pages for MariaDB functions that create, query, and modify JSON values, including JSON_EQUALS() and JSON_NORMALIZE() from MariaDB 10.7, JSON_OVERLAPS() from MariaDB 10.9, JSON_SCHEMA_VALID() from MariaDB 11.1, and JSON_ARRAY_INTERSECT(), JSON_KEY_VALUE(), JSON_OBJECT_FILTER_KEYS(), and JSON_OBJECT_TO_ARRAY() from MariaDB 11.2. For the MariaDB JSON storage and comparison model, see the JSON data type reference. To compare its schema dialect and version limits with MySQL, read JSON Schema validation in MySQL and MariaDB.

Advertisement

  1. JSON_ARRAY_APPEND()

    In MariaDB, JSON_ARRAY_APPEND() is a built-in function that appends a value to a specified array in a JSON document and returns the modified JSON document.
  2. JSON_ARRAY_INSERT()

    In MariaDB, JSON_ARRAY_INSERT() is a built-in function that inserts a value into a specified JSON array and returns a new JSON document.
  3. JSON_ARRAY_INTERSECT()

    Find values shared by two JSON arrays with MariaDB JSON_ARRAY_INTERSECT(). Available from MariaDB 11.2.
  4. JSON_ARRAY()

    Create JSON arrays in MariaDB with JSON_ARRAY(). Learn empty arrays, NULL and Boolean values, escaped strings, and nested values.
  5. JSON_ARRAYAGG()

    Aggregate rows into a JSON array with MariaDB JSON_ARRAYAGG(). Learn DISTINCT, ORDER BY, GROUP BY, LIMIT, and result-size constraints.
  6. JSON_COMPACT()

    In MariaDB, JSON_COMPACT() is a built-in function that removes all unnecessary spaces from a JSON document to reduce the size of the JSON document.
  7. JSON_CONTAINS_PATH()

    Check JSON path existence in MariaDB with JSON_CONTAINS_PATH(). Learn ONE vs ALL, missing paths, and NULL results.
  8. JSON_CONTAINS()

    Test JSON containment in MariaDB with JSON_CONTAINS(). Learn candidate values, optional paths, 0 versus NULL results, and path errors.
  9. JSON_DEPTH()

    In MariaDB, JSON_DEPTH() is a built-in function that returns the maximum depth of a given JSON document.
  10. JSON_DETAILED() / JSON_PRETTY()

    Pretty-print MariaDB JSON with JSON_DETAILED() or its version-dependent JSON_PRETTY() alias. Learn syntax and indentation options.
  11. JSON_EQUALS()

    Compare MariaDB JSON objects by value with JSON_EQUALS(). Learn how key order, whitespace, numeric formatting, and NULL affect the result.
  12. JSON_EXISTS()

    In MariaDB, JSON_EXISTS() is a built-in function that checks whether a given path exists in a given JSON document.
  13. JSON_EXTRACT()

    Extract JSON values in MariaDB with JSON_EXTRACT(). Learn JSONPath, wildcard matches, multi-path arrays, NULL results, and errors.
  14. JSON_INSERT()

    In MariaDB, JSON_INSERT() is a built-in function that inserts one or more pieces of data into a JSON document and returns the new JSON document.
  15. JSON_KEY_VALUE()

    Extract MariaDB JSON object key-value pairs as rows with JSON_KEY_VALUE() and JSON_TABLE(). Available from MariaDB 11.2.
  16. JSON_KEYS()

    In MariaDB, JSON_KEYS() is a built-in function that returns an array containing the topmost member (key) of the specified JSON object.
  17. JSON_LENGTH()

    In MariaDB, JSON_LENGTH() is a built-in function that returns the length of a JSON document or a node within a JSON document specified by a path.
  18. JSON_LOOSE()

    In MariaDB, JSON_LOOSE() is a built-in function that adds whitespace to JSON documents to make them more readable.
  19. JSON_MERGE_PATCH()

    In MariaDB, JSON_MERGE_PATCH() is a built-in function that merges two or more JSON documents and returns the merged result.
  20. JSON_MERGE_PRESERVE()

    In MariaDB, JSON_MERGE_PRESERVE() is a built-in function that merges two or more JSON documents and returns the result.
  21. JSON_MERGE()

    In MariaDB, JSON_MERGE() is a built-in function that merges two or more JSON documents and returns the result.
  22. JSON_NORMALIZE()

    Normalize MariaDB JSON by recursively sorting object keys and removing whitespace. Learn JSON_EQUALS() and JSON uniqueness use cases.
  23. JSON_OBJECT_FILTER_KEYS()

    Keep selected key-value pairs in a MariaDB JSON object with JSON_OBJECT_FILTER_KEYS(). Available from MariaDB 11.2.
  24. JSON_OBJECT_TO_ARRAY()

    Convert MariaDB JSON objects into arrays of key-value pairs with JSON_OBJECT_TO_ARRAY(). Available from MariaDB 11.2.
  25. JSON_OBJECT()

    Create MariaDB JSON objects with JSON_OBJECT(). Learn its empty-list behavior, required key-value pairs, and errors for odd argument counts or NULL keys.
  26. JSON_OBJECTAGG()

    Use MariaDB JSON_OBJECTAGG() from 10.5 to aggregate key-value pairs. Learn GROUP BY, duplicate keys, empty results, and the group_concat_max_len limit.
  27. JSON_OVERLAPS()

    Check whether MariaDB JSON arrays, objects, or scalar values overlap with JSON_OVERLAPS(). Available from MariaDB 10.9.
  28. JSON_QUERY()

    In MariaDB, JSON_QUERY() is a built-in function that returns an object or array from a JSON document based on the provided path.
  29. JSON_QUOTE()

    Use MariaDB JSON_QUOTE() to wrap strings as JSON literals and escape special characters. Learn NULL and non-string argument behavior.
  30. JSON_REMOVE()

    In MariaDB, JSON_REMOVE() is a built-in function that removes the data specified by path from a JSON document.
  31. JSON_REPLACE()

    In MariaDB, JSON_REPLACE() is a built-in function that replaces existing data in a JSON document and returns the new JSON document.
  32. JSON_SCHEMA_VALID()

    Validate JSON documents locally in your browser, or use MariaDB JSON_SCHEMA_VALID() from version 11.1 to check against Draft 2020.
  33. JSON_SEARCH()

    In MariaDB, JSON_SEARCH() is a built-in function that returns the path of a given value within a given JSON document.
  34. JSON_SET()

    In MariaDB, JSON_SET() is a built-in function that inserts or updates data in a JSON document and returns the new JSON document.
  35. JSON_TABLE()

    In MariaDB, JSON_TABLE() is a built-in function that extracts data from a specified JSON document and returns a relational table with specified columns.
  36. JSON_TYPE()

    In MariaDB, JSON_TYPE() is a built-in function that returns the type of a given JSON value as a string.
  37. JSON_UNQUOTE()

    Use MariaDB JSON_UNQUOTE() to remove JSON string quotes and unescape values. Learn pass-through behavior, invalid strings, NULL, and SQL modes.
  38. JSON_VALID()

    Check JSON validity in MariaDB with JSON_VALID(). Learn 1, 0, and NULL results, SQL TRUE versus JSON true, and automatic JSON column checks.
  39. JSON_VALUE()

    Extract scalar values in MariaDB with JSON_VALUE(). Learn when invalid JSON, missing paths, or non-scalar values return NULL.