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

前端 未结 6 1885
孤独总比滥情好
孤独总比滥情好 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:16

    If you are getting mongodb-error validating settings: only one positional argument is allowed.

    1. Just put --file path in " ".

    2.use / instead of \ in --file path.

    1. Also, put --host in " ".

    For example:
    Suppose you are trying to import data from your local machine to server (MongoDB Atlas or your MongoDB server or locally) in your collection then follow this:

    mongoimport --host "cluster0-shard-00-01-ceax1.mongodb.net:27017" --db  --type json --file "C:/Users/ranjeet/Downloads/MongoDb project/ranjeet.json" --authenticationDatabase admin --ssl --username  --password  --collection 
    

提交回复
热议问题