查詢有幾個數(shù)據(jù)庫
show dbs
引用當前庫
db
切換數(shù)據(jù)庫
use 數(shù)據(jù)庫名
實列:
use lacal
注意:空數(shù)據(jù)庫是不顯示的】兜酰空數(shù)據(jù)庫是一個沒有物理數(shù)據(jù)的。
刪除庫
db.dropDayabase()
表操作
查詢表
show collections
隱式刪除庫下的數(shù)據(jù)
db.users.drop()
返回true就是成功
查詢庫下面的數(shù)據(jù)表
show collections
隱式創(chuàng)建表
db.users.insertOne()
顯示創(chuàng)建表
db.createCollection("")