Extract values from JSON type

suggest change

Introduction

MySQL 5.7.8+ supports native JSON type. While you have different ways to create json objects, you can access and read members in different ways, too.

The main function is JSON_EXTRACT. The -> and ->> operators are easier to read. -> returns JSON; ->> unquotes a scalar and returns a string.

Syntax

Parameters

Parameter Description
json_doc A valid JSON document
path Path to a member

Remarks

Mentioned in MySQL 5.7 Reference Manual

If it is possible that those arguments could return multiple values, the matched values are autowrapped as an array, in the order corresponding to the paths that produced them. Otherwise, the return value is the single matched value.

Returns NULL if any argument is NULL or no paths locate a value in the document.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents