mongo export SyntaxError: missing ; before statement @(shell):1:14

mongo export SyntaxError: missing ; before statement @(shell):1:14

您好,我正在尝试使用以下命令行导出我的 mongo collection 之一:

mongoexport --host 127.0.0.1 --port 3001 --db meteor --collection subs --out subs.json

但是我收到这个错误,我不明白为什么,因为每个 post 都使用这个命令并且它对他们有效

2017-11-14T10:23:31.562+0100 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:14

mongoexport 必须是来自您的 OS 命令 shell 的 运行,而不是 mongo shell.