Error in running the last lab - importDataset

Hi, I ran the command as below which gives 0 imported. I tried with and without quotes around the path. I looked at a couple of topics on the same issue which were helpful like running this in vagrant etc. For user creation I have the screen shot at the bottom.
What should I check?

vagrant@m103:/var/mongodb/db$ mongoimport -u m103-application-user -p m103-application-pass --collection products --authenticationDatabase admin --db applicationData --port C:\MinGW\bin\m103-vagrant-env\dataset27000 products.json
2019-02-19T15:19:59.203+0000 Failed: open products.json: no such file or directory
2019-02-19T15:19:59.213+0000 imported 0 documents
vagrant@m103:/var/mongodb/db$ mongoimport -u m103-application-user -p m103-application-pass --collection products --authenticationDatabase admin --db applicationData --port 27000 C:\MinGW\bin\m103-vagrant-env\dataset\products.json
2019-02-19T15:21:47.560+0000 Failed: open C:MinGWbinm103-vagrant-envdatasetproducts.json: no such file or directory
2019-02-19T15:21:47.561+0000 imported 0 documents
vagrant@m103:/var/mongodb/db$ mongoimport -u m103-application-user -p m103-application-pass --collection products --authenticationDatabase admin --db applicationData --port 27000 “C:\MinGW\bin\m103-vagrant-env\dataset\products.json”
2019-02-19T15:23:28.674+0000 Failed: open C:\MinGW\bin\m103-vagrant-env\dataset\products.json: no such file or directory
2019-02-19T15:23:28.675+0000 imported 0 documents
vagrant@m103:/var/mongodb/db$

casionMongoDB Enterprise > db.createUser( {user: “m103-application-user”, pwd: “m103-application-pass”,roles:[{db:“applicationData”, role:“readWrite”}]}) les:[{db:"appli
Successfully added user: { les:[{db:"appl
“user” : “m103-application-user”, les:[{db:"app
“roles” : [ les:[{db:"ap
{ les:[{db:"a
“db” : “applicationData”, les:[{db:"commended w “role” : “readWrite” les:[{db:
}

You should just use the file given in the lab : try this full path
/dataset/products.json

1 Like

Thanks Patrick. The file did come with the handout early in the class so that is how I got that. But the problem was using my windows type of \ slash(es) as opposed to linux way i.e. / which your post helped me to notice what I was missing. So thank you.
Ashok

1 Like