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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.