
Building JSON Output With JSON_OBJECT and JSON_ARRAYAGG
Build nested JSON from MySQL tables with JSON_OBJECT and JSON_ARRAYAGG, and handle booleans, ordering, empty results and join fan-out.
The workhorse behind half the web. Queries, quirks and storage-engine lore for keeping it quick, correct and out of the pager.

Build nested JSON from MySQL tables with JSON_OBJECT and JSON_ARRAYAGG, and handle booleans, ordering, empty results and join fan-out.

MEMBER OF, JSON_CONTAINS, JSON_OVERLAPS and JSON_SEARCH compared on real tables, with a multi-valued index, and the matching rules for numbers and strings.

JSON_TABLE in MySQL 8 turns JSON arrays into typed rows. Syntax, nested paths, default and error clauses, the silent NULLs, and timings on 250,000 items.

MySQL cannot index a JSON column directly. Add a generated column, index it, and learn the collation, NULL and cast traps that change query results.

Use JSON_SET, JSON_REPLACE, JSON_REMOVE and array functions to change one part of a MySQL JSON column, with partial updates, binlog size and the counter trap.

How MySQL JSON paths work, what JSON_EXTRACT returns for each value type, why -> and ->> are not the same, and the path rules that cause errors.

Create a MySQL JSON column with a default, insert documents several ways, then filter, sort and group on keys, with the NULL and ordering traps checked.

A working guide to MySQL 8.4 JSON columns: paths, reading, updating, searching, generated-column and multi-valued indexes, and MariaDB differences.

LOAD DATA LOCAL clips long strings and out of range numbers to the nearest value and only warns. See each warning, the checks that find them, and the fix.

Measure what other sessions see while LOAD DATA runs on InnoDB, whether chunking helps, and how a build and swap with RENAME TABLE avoids any visible window.

Use a GUI import wizard for small files and LOAD DATA for big ones. See the measured gap between row at a time and bulk loading, and what a GUI sends.

MySQL rejects a US date with error 1292 on a server load and stores a zero date on a LOCAL load. See both, the STR_TO_DATE fix, and how to find zero dates.
We send one email when a new article is published. No spam.