From 48eec1a42b0699b91be303d41d9bf341e8c39bcb Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Thu, 31 Oct 2024 01:59:03 +0700 Subject: [PATCH] mysql json --- docs/2022-07-31-sql.html | 46 ++++++++++++++++++++++++++++------------ posts/2022-07-31-sql.md | 6 ++++-- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/docs/2022-07-31-sql.html b/docs/2022-07-31-sql.html index b6c9e73..b475516 100644 --- a/docs/2022-07-31-sql.html +++ b/docs/2022-07-31-sql.html @@ -124,24 +124,42 @@

JSON data type is also useful for dumping request, response data.

-

- Use JSON_EXTRACT(col, '$.key') IS NULL to check json field - exist or not. -

Use index!!!

'$.key'` to get value + - [For MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/json.html) - [For MySQL 8.0](https://dev.mysql.com/doc/refman/8.0/en/json.html) - -Use `JSON_EXTRACT(col, '$.key') IS NULL` to check json field exist or not. +- [Indexing JSON in MySQL](https://planetscale.com/blog/indexing-json-in-mysql) ## Use index!!!