With MySQL8.0.25 as database backend, I make Django ORM to update the following JSONField value
{
"01-task1": {"data":"huge data here"}
}
just add a new element , "02-testing": {}
but I got the following sql log
(0.000) UPDATE `by_jsontree_store1` SET `store_type` = 1, `user_id` = 2, `data` = '{\"01-task1\": {\"data\": \"huge data here\"}, \"02-testing\": {}}'
WHERE `by_jsontree_store1`.`id` = 1; args=(1, 2, '{"01-task1": {"data": "huge data here"}, "02-testing": {}}', 1)
It looks like Django rewrite the whole content of that JSONField.
The Django JSONField does map to MySQL JSON column type, as the following table struct shows.
Imaging if the original content is huge, like 100MB, what could happen.
Could Django update JSON field partially, just update what it need to?