SyntaxStudy
Sign Up
MySQL MySQL JSON — Summary
MySQL Beginner 3 min read

MySQL JSON — Summary

MySQL JSON Summary

MySQL's JSON type provides validation, path extraction (->), modification (JSON_SET), aggregation (JSON_ARRAYAGG), and search functions. Generated columns enable indexing.

Example
-- Common JSON operations cheatsheet
-- Read:    col->'$.key'        or JSON_EXTRACT(col, '$.key')
-- Unquote: col->>'$.key'       or JSON_UNQUOTE(JSON_EXTRACT(...))
-- Set:     JSON_SET(col, '$.key', value)
-- Remove:  JSON_REMOVE(col, '$.key')
-- Append:  JSON_ARRAY_APPEND(col, '$', value)
-- Search:  JSON_SEARCH(col, 'one', value)
-- Exists:  JSON_CONTAINS_PATH(col, 'one', '$.key')
Pro Tip

Bookmark this cheatsheet — JSON function names are easy to confuse.