All pages
Powered by GitBook
1 of 1

Loading...

JSON_SET

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.

Syntax

JSON_SET(json_doc, path, val[, path, val] ...)

Description

Updates or inserts data into a JSON document, returning the result, or NULL if any of the arguments are NULL or the optional path fails to find an object.

An error will occur if the JSON document is invalid, the path is invalid or if the path contains a * or a wildcard**.**

JSON_SET can update or insert data, while can only update, and only insert.

Examples

This page is licensed: CC BY-SA / Gnu FDL

SELECT JSON_SET(Priv, '$.locked', 'true') FROM mysql.global_priv
JSON_REPLACE
JSON_INSERT