Load JSON Quickly
Start a copy of the new shell with mysqlsh. Connect to your favorite server \c dave@localhost and then create a new schema session.createSchema('bulk'). Then point you session to the schema just created with \use bulk. Version 8.0.13 has a new utility function named importJson that does the work. The first argument is the path to the data set (here the MongoDB restaurant collection) and the second allows you to designate the schema and collection where you wish to have the data stored. In this example the data set was in the downloads directory of my laptop and I wanted to put it in the newly created 'bulk' schema in a collection named 'restaurants'
|An Example of using util.importJson to quickly load JSON data into the MySQL Document Store|
It took just over 2 seconds to read in over 25,000 records, not bad.
|And a quick check of the data shows that is loaded successfully!|