mongodb-error验证设置:仅允许使用一个位置参数 [英] mongodb-error validating settings: only one positional argument is allowed

查看:581
本文介绍了mongodb-error验证设置:仅允许使用一个位置参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚搬到一台新的笔记本电脑上,我相信它具有mongo 3.0.0. 在新笔记本电脑上,我安装了mongo 3.0.4.并尝试在旧笔记本电脑上运行的脚本给了我错误.这行给我错误.

I just moved to a new laptop which had mongo 3.0.0 I believe. On the new laptop I have mongo 3.0.4. and trying the script that was working on the old laptop is giving me errors. This line is giving me the error.

mongoimport --host localhost \
            -db roudy123_q \
            -collection LebaneseAmericanUniversity\(Lebanon\).json \
            --file LebaneseAmericanUniversity\(Lebanon\).json \
            --jsonArray

错误验证设置:仅允许使用一个位置参数.

error validating settings: only one positional argument is allowed.

我搜索了该错误,唯一相关的结果是mongoimport的源代码.所以我想这与新版本有关.

I googled the error and the only relevant result was the source code of mongoimport. So I guess it has something to do with the new version.

推荐答案

只是一个疯狂的猜测...

Just a wild guess...

...,但应使用--而不是-指定各种长选项:

... but the various long options should be specified using --, not -:

mongoimport --host localhost \
            --db roudy123_q \
            --collection LebaneseAmericanUniversity\(Lebanon\).json \
            --file LebaneseAmericanUniversity\(Lebanon\).json \
            --jsonArray

也许mongoimport的这个特定版本对此更为准点,并且会将-db ... -collection ...视为位置参数而不是关键字参数?

Maybe this particular version of mongoimport is more punctilious about that, and will treat -db ... -collection ... as positional arguments rather than keyword arguments ?

这篇关于mongodb-error验证设置:仅允许使用一个位置参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆