How to import data into mongoDB

前端 未结 2 1343
-上瘾入骨i
-上瘾入骨i 2021-01-20 15:36

I\'m trying to import a large data file in JSON format . I\'m using

mongoimport --db verbs --collection de --file \"/Users/marcelbraasch/Downloads/de.json\"

相关标签:
2条回答
  • 2021-01-20 16:36

    I was struggling with the same issue, adding keyword --authenticationDatabase worked for me.

    0 讨论(0)
  • 2021-01-20 16:38

    Found the answer here. This missing keyword was authenticationDatabase. The command that worked for me was:

    mongoimport --db verbs --collection de --authenticationDatabase admin --username user --password password --drop --file /Users/myname/Downloads/de.json.

    0 讨论(0)
提交回复
热议问题