Inserting documents
You may want to add some test data into a database while developing an application. Inserting documents can be done with MySQL Shell. A document is a JSON data structure that's similar to a record in SQL.
JSON stands for JavaScript Object Notation. It is a method to describe a data structure in text format. As most programming languages and databases support this, it is a good format for data exchange.
A collection of documents is similar to a table with records. A table has a structure to describe what each record should look like. But this is not the case for documents. You can define some additional requirements for collections, but this is not the default. A document is also more flexible, as it can have nested data.
Here is an example of nested data in a JSON document:
{ Â Â "type": "book", Â Â "title": "Harry Potter and the Philosopher's Stone", Â Â "translations"...