cosmos icon indicating copy to clipboard operation
cosmos copied to clipboard

secretary0数据库备份方案征求

Open zhangshenhua opened this issue 5 years ago • 0 comments

secretary0::[194楼 5e211f0cbef4354d53f6cf13]::知乎面壁者@undefined: 现在secretary0这个程序遇到一个技术上的麻烦: 它的后台数据库是mongodb。 但是由于我第一次使用mongodb缺乏经验,设计时将collection的命名为<房名>, 对于这个宇宙来说就是'/',从而导致无法用mongodump命令进行备份:

[root@VM_0_12_centos ~]# mongodump -d cosmos connected to: 127.0.0.1 2020-01-17T10:40:25.147+0800 DATABASE: cosmos to dump/cosmos 2020-01-17T10:40:25.147+0800 cosmos.system.indexes to dump/cosmos/system.indexes.bson 2020-01-17T10:40:25.147+0800 5 documents Cannot dump cosmos./. Collection has '/' or null in the collection name. Cannot dump cosmos./意见箱. Collection has '/' or null in the collection name. 2020-01-17T10:40:25.147+0800 cosmos.system.js to dump/cosmos/system.js.bson 2020-01-17T10:40:25.148+0800 1 documents 2020-01-17T10:40:25.148+0800 Metadata for cosmos.system.js to dump/cosmos/system.js.metadata.json [root@VM_0_12_centos ~]#

有待高手指点

zhangshenhua avatar Jan 17 '20 12:01 zhangshenhua