<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="json-function-reference">
      </a>
      14.17.1 JSON Function Reference
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045195828192">
  </a>
  <div class="table">
   <a name="idm46045195827120">
   </a>
   <p class="title">
    <b>
     Table 14.22 JSON Functions
    </b>
   </p>
   <div class="table-contents">
    <table frame="box" rules="all" summary="A reference that lists all JSON functions.">
     <colgroup>
      <col style="width: 25%"/>
      <col style="width: 62%"/>
      <col style="width: 12%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Name
       </th>
       <th>
        Description
       </th>
       <th>
        Deprecated
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#operator_json-column-path">
         <code class="literal">
          -&gt;
         </code>
        </a>
       </th>
       <td>
        Return value from JSON column after evaluating path; equivalent to
      JSON_EXTRACT().
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#operator_json-inline-path">
         <code class="literal">
          -&gt;&gt;
         </code>
        </a>
       </th>
       <td>
        Return value from JSON column after evaluating path and unquoting
      the result; equivalent to JSON_UNQUOTE(JSON_EXTRACT()).
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-creation-functions.html#function_json-array">
         <code class="literal">
          JSON_ARRAY()
         </code>
        </a>
       </th>
       <td>
        Create JSON array
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-array-append">
         <code class="literal">
          JSON_ARRAY_APPEND()
         </code>
        </a>
       </th>
       <td>
        Append data to JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-array-insert">
         <code class="literal">
          JSON_ARRAY_INSERT()
         </code>
        </a>
       </th>
       <td>
        Insert into JSON array
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-contains">
         <code class="literal">
          JSON_CONTAINS()
         </code>
        </a>
       </th>
       <td>
        Whether JSON document contains specific object at path
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-contains-path">
         <code class="literal">
          JSON_CONTAINS_PATH()
         </code>
        </a>
       </th>
       <td>
        Whether JSON document contains any data at path
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-attribute-functions.html#function_json-depth">
         <code class="literal">
          JSON_DEPTH()
         </code>
        </a>
       </th>
       <td>
        Maximum depth of JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-extract">
         <code class="literal">
          JSON_EXTRACT()
         </code>
        </a>
       </th>
       <td>
        Return data from JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-insert">
         <code class="literal">
          JSON_INSERT()
         </code>
        </a>
       </th>
       <td>
        Insert data into JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-keys">
         <code class="literal">
          JSON_KEYS()
         </code>
        </a>
       </th>
       <td>
        Array of keys from JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-attribute-functions.html#function_json-length">
         <code class="literal">
          JSON_LENGTH()
         </code>
        </a>
       </th>
       <td>
        Number of elements in JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-merge">
         <code class="literal">
          JSON_MERGE()
         </code>
        </a>
       </th>
       <td>
        Merge JSON documents, preserving duplicate keys. Deprecated
      synonym for JSON_MERGE_PRESERVE()
       </td>
       <td>
        Yes
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-merge-patch">
         <code class="literal">
          JSON_MERGE_PATCH()
         </code>
        </a>
       </th>
       <td>
        Merge JSON documents, replacing values of duplicate keys
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-merge-preserve">
         <code class="literal">
          JSON_MERGE_PRESERVE()
         </code>
        </a>
       </th>
       <td>
        Merge JSON documents, preserving duplicate keys
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-creation-functions.html#function_json-object">
         <code class="literal">
          JSON_OBJECT()
         </code>
        </a>
       </th>
       <td>
        Create JSON object
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-overlaps">
         <code class="literal">
          JSON_OVERLAPS()
         </code>
        </a>
       </th>
       <td>
        Compares two JSON documents, returns TRUE (1) if these have any
      key-value pairs or array elements in common, otherwise FALSE (0)
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-utility-functions.html#function_json-pretty">
         <code class="literal">
          JSON_PRETTY()
         </code>
        </a>
       </th>
       <td>
        Print a JSON document in human-readable format
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-creation-functions.html#function_json-quote">
         <code class="literal">
          JSON_QUOTE()
         </code>
        </a>
       </th>
       <td>
        Quote JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-remove">
         <code class="literal">
          JSON_REMOVE()
         </code>
        </a>
       </th>
       <td>
        Remove data from JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-replace">
         <code class="literal">
          JSON_REPLACE()
         </code>
        </a>
       </th>
       <td>
        Replace values in JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-validation-functions.html#function_json-schema-valid">
         <code class="literal">
          JSON_SCHEMA_VALID()
         </code>
        </a>
       </th>
       <td>
        Validate JSON document against JSON schema; returns TRUE/1 if
      document validates against schema, or FALSE/0 if it does not
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-validation-functions.html#function_json-schema-validation-report">
         <code class="literal">
          JSON_SCHEMA_VALIDATION_REPORT()
         </code>
        </a>
       </th>
       <td>
        Validate JSON document against JSON schema; returns report in JSON
      format on outcome on validation including success or failure and
      reasons for failure
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-search">
         <code class="literal">
          JSON_SEARCH()
         </code>
        </a>
       </th>
       <td>
        Path to value within JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-set">
         <code class="literal">
          JSON_SET()
         </code>
        </a>
       </th>
       <td>
        Insert data into JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-utility-functions.html#function_json-storage-free">
         <code class="literal">
          JSON_STORAGE_FREE()
         </code>
        </a>
       </th>
       <td>
        Freed space within binary representation of JSON column value
      following partial update
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-utility-functions.html#function_json-storage-size">
         <code class="literal">
          JSON_STORAGE_SIZE()
         </code>
        </a>
       </th>
       <td>
        Space used for storage of binary representation of a JSON document
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-table-functions.html#function_json-table">
         <code class="literal">
          JSON_TABLE()
         </code>
        </a>
       </th>
       <td>
        Return data from a JSON expression as a relational table
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-attribute-functions.html#function_json-type">
         <code class="literal">
          JSON_TYPE()
         </code>
        </a>
       </th>
       <td>
        Type of JSON value
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-modification-functions.html#function_json-unquote">
         <code class="literal">
          JSON_UNQUOTE()
         </code>
        </a>
       </th>
       <td>
        Unquote JSON value
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-attribute-functions.html#function_json-valid">
         <code class="literal">
          JSON_VALID()
         </code>
        </a>
       </th>
       <td>
        Whether JSON value is valid
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#function_json-value">
         <code class="literal">
          JSON_VALUE()
         </code>
        </a>
       </th>
       <td>
        Extract value from JSON document at location pointed to by path
      provided; return this value as VARCHAR(512) or specified type
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <a class="link" href="json-search-functions.html#operator_member-of">
         <code class="literal">
          MEMBER OF()
         </code>
        </a>
       </th>
       <td>
        Returns true (1) if first operand matches any element of JSON
      array passed as second operand, otherwise returns false (0)
       </td>
       <td>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th style="width: 258.891px;">
        Name
       </th>
       <th style="width: 389.953px;">
        Description
       </th>
       <th style="width: 89.1562px;">
        Deprecated
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   MySQL supports two aggregate JSON functions
   <a class="link" href="aggregate-functions.html#function_json-arrayagg">
    <code class="literal">
     JSON_ARRAYAGG()
    </code>
   </a>
   and
   <a class="link" href="aggregate-functions.html#function_json-objectagg">
    <code class="literal">
     JSON_OBJECTAGG()
    </code>
   </a>
   . See
   <a class="xref" href="aggregate-functions-and-modifiers.html" title="14.19 Aggregate Functions">
    Section 14.19, “Aggregate Functions”
   </a>
   , for
      descriptions of these.
  </p>
  <p>
   MySQL also supports
   <span class="quote">
    “
    <span class="quote">
     pretty-printing
    </span>
    ”
   </span>
   of JSON values
      in an easy-to-read format, using the
   <a class="link" href="json-utility-functions.html#function_json-pretty">
    <code class="literal">
     JSON_PRETTY()
    </code>
   </a>
   function. You can see
      how much storage space a given JSON value takes up, and how much
      space remains for additional storage, using
   <a class="link" href="json-utility-functions.html#function_json-storage-size">
    <code class="literal">
     JSON_STORAGE_SIZE()
    </code>
   </a>
   and
   <a class="link" href="json-utility-functions.html#function_json-storage-free">
    <code class="literal">
     JSON_STORAGE_FREE()
    </code>
   </a>
   , respectively.
      For complete descriptions of these functions, see
   <a class="xref" href="json-utility-functions.html" title="14.17.8 JSON Utility Functions">
    Section 14.17.8, “JSON Utility Functions”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
