用use newdb
创建新的数据库不插入任何数据的情况下用show dbs
是不会显示这个数据库的,这样的话应该没加到内存。但是删除它却显示{ "ok" : 1 }
没报错,所以我想问一下创建新的空数据库有没有存储起来?
黄舟2017-04-28 09:06:09
1. No storage
2. You can execute this command test again after passing db.dropDatabase(), and it will also return { ok: 1 }
use memberSystem
switched to db memberSystem
db.dropDatabase()
{ "dropped" : "memberSystem", "ok" : 1 }
db.dropDatabase()
{ "dropped" : "memberSystem", "ok" : 1 }
db.dropDatabase()
3. Mongodb will not determine whether the database exists when deleting, but directly performs the deletion process. As long as no error is reported, {ok:1} will be returned, even if there is no such database