在 MongoDB 中导入文件时出错 群集错误验证设置:不兼容的选项:--文件和位置参数

Error importing file in MongoDB Cluster error validating settings: incompatible options: --file and positional argument(s)

我正在尝试使用 mongo将我现有的 .json 文件导入到云集群中。但是我一直收到这个错误

错误验证设置:不兼容的选项:--文件和位置参数

我和 mongo 一起讨论了一个小时,他们没有帮助解决我的问题。我认为这与 --file drivers.json 和它找到该文件有关。

./mongoimport --host muleapp-shard-00-02-bxny3.mongodb.net:27017 --ssl --username srusso -password MuleApp2019 --authenticationDatabase admin --db Drivers --collection driver --type json --file drivers.json

验证设置时出错:不兼容的选项:--文件和位置参数

现在出现超时错误:

2019-11-08T14:12:38.533-0500 错误连接到主机:无法连接到服务器:服务器选择错误:服务器选择超时 当前拓扑结构:类型:单 服务器: 地址:muleapp-shard-00-02-bxny3.mongodb.net:27017,类型:未知,状态:已连接,平均 RTT:0,最后一个错误:connection() : dial tcp 3.229.7.228:27017: i/o超时

第一个错误可能是由于使用 - 而不是 -- 提供的长选项密码。因此,该选项可以作为 --password MuleApp2019-p MuleApp2019 之一提供。