All pages
Powered by GitBook
1 of 1

Loading...

JSON_OBJECT

Create a JSON object. This function evaluates a list of key-value pairs and returns a JSON object containing those pairs.

Syntax

JSON_OBJECT([key, value[, key, value] ...])

Description

Returns a JSON object containing the given key/value pairs. The key/value list can be empty.

An error will occur if there are an odd number of arguments, or any key name is NULL.

Example

See also

  • , the CONNECT storage engine function

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

SELECT JSON_OBJECT("id", 1, "name", "Monty");
+---------------------------------------+
| JSON_OBJECT("id", 1, "name", "Monty") |
+---------------------------------------+
| {"id": 1, "name": "Monty"}            |
+---------------------------------------+
JSON_MAKE_OBJECT