mongodb导入数据库

  sre

E138F0402C08FD856CE42213CE8121B9.jpg

mongorestore  -h mongo.host -u root -p *** --port 22017 --authenticationDatabase admin -d  resources --directoryperdb v112222——resources
mongoimport -h mongo.host --port 22017 -u root -p **** --authenticationDatabase admin --db third_swap_data --collection c005 --file collection1.json

集合导入导出:

bin/mongoexport -h localhost:27107 -u user -p pwd -d database -c collection -o out.json
bin/mongoimport -h localhost:27107 -u user -p pwd -d database -c new_collection ./out.json

LEAVE A COMMENT

Captcha Code