Chapter 1 The Mongod Lab: Importing a Dataset

mongod.conf

storage:
dbPath: /var/mongodb/db
net:
bindIp: localhost
port: 27000
security:
authorization: enabled
systemLog:
destination: file
path: /var/mongodb/logs/mongod.log
logAppend: true
processManagement:
fork: true

terminal ::

mkdir -p /var/mongodb/db

mongoimport --port 27000 -u m103-application-user -p m103-application-pass --authenticationDatabase admin -d applicationData -c applicationData.products --file “/dataset/products.json”

I am getting like this, could please help me resolve it.

Test Reults ::

1 total, 0 passed, 0 skipped:
[FAIL] “The whole dataset was imported”

Did you import the dataset into the ‘products’ collection of the ‘applicationData’ database?

Do you see data in products collection under applicationData db?
Query the collection and check
Also no need to mention applicationData.products in your mongoimport command as you are specifying target db

1 Like

could you please send the command it is showing error

It is displaying like this

SOLUTION :::::

mongoimport --port 27000 -u m103-application-user -p m103-application-pass --authenticationDatabase admin -d applicationData --file “/dataset/products.json”

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.