mongorestore未捕获异常:语法错误
我已经转储了一些数据库,mongodump这意味着我目前有一个文件夹(哪个名称,是我转储数据库的日期)和我拥有的每个数据库的一个文件夹,并且在每个数据库文件夹中我每个集合有 2 个文件,一个 . bson 和一个 .metadata.json。
现在我想使用mongorestore以下命令重建数据库及其集合:
mongorestore --db user --verbose /home/nvsh120/projects/database/11-26-20/user
但它不起作用并退出并出现以下错误:
uncaught exception: SyntaxError: unexpected token: identifier :
@(shell):1:15
回答
所以问题是我试图mongorestore从 mongo shell运行,而我应该从 windowslinux 命令提示符终端运行它。