Mongodb mongorestore与收藏
嗨,当我使用mongorestore转储我的数据库时Mongodb mongorestore与收藏,mongodb,mongorestore,Mongodb,Mongorestore,嗨,当我使用mongorestore转储我的数据库时ok 如果我有: > show dbs local (empty) test 0.203125GB 它变成: > show dbs local (empty) test 0.203125GB ok 0.203125GB 但是如果我做一个db.getCollectionName()它只会打印出来 > db.getCollectionNames() [ "system.indexes",
ok
如果我有:
> show dbs
local (empty)
test 0.203125GB
它变成:
> show dbs
local (empty)
test 0.203125GB
ok 0.203125GB
但是如果我做一个db.getCollectionName()
它只会打印出来
> db.getCollectionNames()
[ "system.indexes", "test", "users" ]
我想要ok出现在这里,我该怎么办
谢谢
Ok
将永远不会出现在收藏列表中,因为Ok
是数据库,而不是收藏。数据库包含许多集合,但不是集合本身
要查看ok
数据库中的集合,请键入使用ok
,后跟db.getCollectionNames()代码>
如果要备份和还原单个集合,则需要使用mongodump和mongorestore的--collection
参数。有关更多信息,请参阅