mongodb-error validating settings: only one positional argument is allowed

前端 未结 6 1891
孤独总比滥情好
孤独总比滥情好 2021-02-08 09:35

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

6条回答
  •  不思量自难忘°
    2021-02-08 10:13

    None of the above mentioned answers solved my problem but they indeed helped me in figuring out what I was doing wrong.(I am using windows)

    1)using -d instead of --d (shorthand only require one - not two --)

    2)using "" for absolute file path.

    3)Changing \ to / in file path location.

    For example my files location in windows is: C:\kp github\other projects\projectXyz\myFile.csv

    So for me the command that worked was:

    mongoimport -d users -c contacts --type=csv --headerline --file="C:/kp github/other projects/projectXyz/myFile.csv" or

    mongoimport -d users -c contacts --type csv --headerline --file "C:/kp github/other projects/projectXyz/myFile.csv"

    where users is my db name and contacts is my collection name

提交回复
热议问题