Chapter 7: New Features of MySQL 8.0-NoSQL Document Storage

Direct learning: https://edu.csdn.net/course/play/27328/370726
# 1, what is NoSQL?
NoSQL is short for not only sql, which means more than SQL;
NoSQL refers to non-relational database.
# 2, the classification of
NoSQL database NoSQL database database can be roughly divided into four categories: key value storage, column storage, document storage and graphic storage.
Insert picture description here
# 3, mysql document storage:
When mysql is used as a document storage, the collection is a container, and the collection contains JSON documents that can be added, found, updated, and deleted.
Insert picture description here
# 4. The sample code is as follows:

mysqlsh root@localhost:33060/mylb
root
db
db.getCollections()
db.createCollection("employee_ds")
db.getCollections()
db.employee_ds.add({
"id":1,
"name":"张三",
"sex":"男",
"salary":5500,
"dept":"部门A"
})
db.employee_ds.add({
"id":1,
"name":"李四",
"sex":"男",
"salary":5500,
"dept":"部门A"
})
db.employee_ds.find()

db.employee_ds.find("name"="张三")
db.employee_ds.remove("name"="张三")
db.employee_ds.remove("true")
db.employee_ds.find()
db.dropCollection("employee_ds")
Published 114 original articles · Likes6 · Visits 1007

Guess you like

Origin blog.csdn.net/weixin_43597208/article/details/105544562