unable to install mongoimport and mongoexport

164 Views Asked by At

I am doing a coursera problem where I need to install mongoexpert and mongoimport.

I used the method below but I am getting error. How do I fix this error? Thanks.

enter image description here

enter image description here

enter image description here

1

There are 1 best solutions below

0
Jose_Peeterson On BEST ANSWER

first need to Start the mongodb server.

start_mongo

Make a note of the username and password based on the output of the previous command.

Import data in 'diamonds.json' into a collection named 'diamonds' and a database named 'training', replacing the password (the characters following -p: MzA2NDAtcnNhbm5h) with your own password.

mongoimport -u root -p MzA2NDAtcnNhbm5h --authenticationDatabase admin --db training --collection diamonds --file diamonds.json