mongorestore
Utility to import a collection or database from a binary dump into a MongoDB instance. More information: https://www.mongodb.com/docs/database-tools/mongorestore/.
- Import a BSON data dump from a directory to a MongoDB database:
mongorestore --db
- Import a BSON data dump from a directory to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password):
mongorestore --host --db --username --password
- Import a collection from a BSON file to a MongoDB database:
mongorestore --db
- Import a collection from a BSON file to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password):
mongorestore --host --db --username --password
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
