mongoDB创建新的空数据库有没有存储起来?
ringa_lee
ringa_lee 2017-04-28 09:04:09
0
1
524

use newdb创建新的数据库不插入任何数据的情况下用show dbs是不会显示这个数据库的,这样的话应该没加到内存。但是删除它却显示{ "ok" : 1 }没报错,所以我想问一下创建新的空数据库有没有存储起来?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
黄舟

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template