MongoDB創(chuàng)建數(shù)據(jù)庫完全可以使用use
如下:
use mydb;
這樣就創(chuàng)建了一個數(shù)據(jù)庫。
這一步很重要如果什么都不操作離開的話 這個庫就會被系統(tǒng)刪除。
驗證-------------------------------
然后使用插入語句:
db.user.insert({name:'tompig'});
在使用下列命令查看
show collections; ---查看‘表’
show dbs ---查看庫
如圖操作:

mongodb 刪除數(shù)據(jù)庫
use mydb;
db.dropDatabase();
mongodb刪除表
db.mytable.drop();