The latest release of the MySQL Shell 8.0.14 (GA) improved the JSON import utility to support the conversion of more BSON data types from the strict mode representation of MongoDB Extended JSON. This removes a previous limitation regarding the import of more complex MongoDB data types to MySQL, making it more reliable.…
Tag Archives: JSON
Import JSON to MySQL made easy with the MySQL Shell
The latest release of the MySQL Shell 8.0.13 (GA) introduced some interesting improvements and features, for more information see the full changelog here: https://dev.mysql.com/doc/relnotes/mysql-shell/8.0/en/mysql-shell-news-8-0-13.html. One of those features was the introduction of a convenient and easy way to import JSON documents to a MySQL Server database.…
MySQL Shell 8.0.13 – What’s New?
The MySQL Development team is proud to announce a new version of the MySQL Shell which in addition to the usual bug fixes and enhancements to the existing components, offers new features we expect are quite useful in your day to day work.…
JSON Labs Release: Overview
Summary
We’re very happy to announce that the MySQL JSON Labs release is now available on MySQL Labs!
With this work, MySQL continues to grow as a hybrid SQL/NoSQL DBMS, one that can offer the best of both worlds to application developers.…
JSON Labs Release: JSON Functions, Part 2 — Querying JSON Data
The MySQL 5.7.7 JSON Lab release introduces a native JSON datatype. In part 1 of this blog post series, Rick Hillegas introduced the new functions for creating and manipulating JSON documents using the new native JSON data type. In this blog post we will be using some of the same sample tables and JSON documents as in part 1, so it will be helpful to read that blog post now, if you haven’t already.…
JSON Labs Release: JSON Functions, Part 1 — Manipulation JSON Data
The MySQL 5.7.7 JSON Lab release introduces a native JSON datatype. See Knut Anders Hatlen’s blog post for more details on this new datatype. In this release we also introduced a number of functions for creating and querying JSON documents. In this post we’ll explore the following new functions related to manipulating JSON documents:
jsn_array()
jsn_object()
jsn_insert()
jsn_remove()
jsn_set()
jsn_replace()
jsn_append()
jsn_merge()
jsn_extract()
Dag Wanvik’s follow up blog post will explore the functions related to querying and searching of JSON documents.…
JSON Labs Release: Native JSON Data Type and Binary Format
In the MySQL 5.7.7 JSON labs release, we have introduced a new data type for storing JSON data in MySQL tables. Now you can do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
mysql> CREATE TABLE employees (data JSON); Query OK, 0 rows affected (0,01 sec) mysql> INSERT INTO employees VALUES ('{"id": 1, "name": "Jane"}'); Query OK, 1 row affected (0,00 sec) mysql> INSERT INTO employees VALUES ('{"id": 2, "name": "Joe"}'); Query OK, 1 row affected (0,00 sec) mysql> select * from employees; +---------------------------+ | data | +---------------------------+ | {"id": 1, "name": "Jane"} | | {"id": 2, "name": "Joe"} | +---------------------------+ 2 rows in set (0,00 sec) |
Sure, you could always store JSON data in a TEXT or VARCHAR column, but having a native data type for JSON provides some major benefits over that approach:
- Document Validation
Only valid JSON documents can be stored in a JSON column, so you get automatic validation of your data.
JSON Labs Release: Effective Functional Indexes in InnoDB
In MySQL 5.7.6, we added a new feature called Generated Columns. In the initial work all Generated Columns were materialized, even virtual ones. This not only resulted in unnecessary disk space being used and disk I/O being done, but it also meant that any table alteration required that the full table be rebuilt.…