我通过以下命令在存档文件中创建了一个转储:
mongodump --archive=newcollection.1.archive --db neel --collection newcollection
Run Code Online (Sandbox Code Playgroud)
在使用 mongorestore 恢复时,我收到一个错误:-- db 和 --collection 参数仅应在从 BSON 文件恢复时使用。
我从 [ https://docs.mongodb.com/manual/reference/program/mongorestore/#examples][1]得到了语法。
我发出了以下命令:
mongorestore --archive=newcollection.1.archive --db backup2.
Run Code Online (Sandbox Code Playgroud)