MySQL JSON Functions

This page lists MySQL JSON functions that perform operations on JSON values.

  1. JSON_ARRAY

    The MySQL JSON_ARRAY() function returns a JSON array that includes all parameters.
  2. JSON_ARRAY_APPEND

    The MySQL JSON_ARRAY_APPEND() function appends a value to a array in a JSON document, specified by a path, and returns the modified JSON document.
  3. JSON_ARRAY_INSERT

    The MySQL JSON_ARRAY_INSERT() function inserts a value into a specified array in a given JSON document and returns a new JSON document.
  4. JSON_CONTAINS

    The MySQL JSON_CONTAINS() function checks whether one JSON document contains another JSON document.
  5. JSON_CONTAINS_PATH

    The MySQL JSON_CONTAINS_PATH() function checks whether a JSON document has a specified path.
  6. JSON_DEPTH

    The MySQL JSON_DEPTH() function returns the maximum depth of a JSON document.
  7. JSON_EXTRACT

    The MySQL JSON_EXTRACT() function extracts the data specified by the path expression in the JSON document and returns it.
  8. JSON_INSERT

    The MySQL JSON_INSERT() function inserts data into a JSON document and return a new JSON document.
  9. JSON_KEYS

    The MySQL JSON_KEYS() function returns an array containing all top-level keys of the specified JSON object.
  10. JSON_LENGTH

    The MySQL JSON_LENGTH() function returns the length of the JSON document or the specified path.
  11. JSON_MERGE

    The MySQL JSON_MERGE() function merges two or more JSON documents and return the combined result.
  12. JSON_MERGE_PATCH

    The MySQL JSON_MERGE_PATCH() function performs a replace merge on two or more JSON documents and returns the merged result.
  13. JSON_MERGE_PRESERVE

    The MySQL JSON_MERGE_PRESERVE() function merges two or more JSON documents and return the combined result.
  14. JSON_OBJECT

    The MySQL JSON_OBJECT() function returns a JSON object containing all the key-value pairs specified by parameters.
  15. JSON_OVERLAPS

    The MySQL JSON_OVERLAPS() function detects whether two JSON documents have any of the same key-value pairs or array elements.
  16. JSON_PRETTY

    The MySQL JSON_PRETTY() function returns the specified JSON document with a pretty format.
  17. JSON_QUOTE

    The MySQL JSON_QUOTE() function wraps a value with double quote and returns it as a JSON string value.
  18. JSON_REMOVE

    The MySQL JSON_REMOVE() function removes the data specified by the path from a JSON document and returns the modified JSON document.
  19. JSON_REPLACE

    The MySQL JSON_REPLACE() function replaces existing data specified by the path in a JSON document and return the modified JSON document.
  20. JSON_SCHEMA_VALID

    The MySQL JSON_SCHEMA_VALID() function verifies a JSON document according to the specified JSON schema.
  21. JSON_SCHEMA_VALIDATION_REPORT

    The MySQL JSON_SCHEMA_VALIDATION_REPORT() function validates a JSON document against a specified JSON schema and returns a validation report.
  22. JSON_SEARCH

    The MySQL JSON_SEARCH() function returns the path of a given string in a JSON document.
  23. JSON_SET

    The MySQL JSON_SET() function inserts or updates data in a JSON document and return a new JSON document.
  24. JSON_STORAGE_FREE

    The MySQL JSON_STORAGE_FREE() function returns the space freed after a JSON column has been updated by JSON_SET(), or JSON_REPLACE(), or JSON_REMOVE().
  25. JSON_STORAGE_SIZE

    The MySQL JSON_STORAGE_SIZE() function returns the number of bytes used to store the binary representation of a JSON document.
  26. JSON_TABLE

    The MySQL JSON_TABLE() function extracts data from a specified JSON document and returns a relational table with the specified columns.
  27. JSON_TYPE

    The MySQL JSON_TYPE() function returns the type of a given JSON value.
  28. JSON_UNQUOTE

    The MySQL JSON_UNQUOTE() function unquotes a JSON value and returns the result as a utf8mb4 string.
  29. JSON_VALID

    The MySQL JSON_VALID() function returns 0 and 1 to indicate whether the given parameter is a valid JSON document.
  30. JSON_VALUE

    The MySQL JSON_VALUE() function extracts the value of the specified path from a specified JSON document and returns it.
  31. MEMBER OF

    The MySQL MEMBER OF() function checks whether a specified value is an element of a JSON array.