The JSONExtract method operates on a JSON instance, to extract data identified by the JSONPath formatted string. If one or more entities are found, the result of this method is a JSON array composed of the values found; otherwise, NULL is returned.
JSONExtract searches the JSON object specified by JSON_expr and retrieves the data that matches the entity name specified by JSONPath_expr.
Condition | Return Value |
---|---|
JSON_expr is null. | NULL |
JSONPath_expr is null. | Error |
Entity specified by JSONPath_expr found in JSON instance. | JSON array whose elements are all the matches for the JSONPath_expr in the JSON instance |
Entity specified by JSONPath_expr not found in JSON instance. | NULL |