Let’s start with some info about how MySQL Document Store handles JSON documents.
Document Store and CRUD
We know that MySQL 8.0 Document Store handles JSON documents with CRUD operations. We can add, delete and modify those documents very easily:
JS >db.mycollection.find() { "_id": "0000624d3e890000000000000001", "name": "my_iot1", "type": "sensor", "capabilities": "{'temperature':'true','humidity':'true'}" } { "_id": "0000624d3e890000000000000002", "name": "my_iot2", "type": "sensor", "capabilities": "{'temperature':'true'}" } 2 documents in set (0.0007 sec)
To modify a document, the modify
method can be used in different
ways:
As illustrate above, we have:
-
set()
- …