Files
tldr/pages.zh/common/mongorestore.md

20 lines
1002 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mongorestore
> 用于将二进制转储中的集合或数据库导入到MongoDB实例的实用程序。
> 更多信息:<https://docs.mongodb.com/database-tools/mongorestore/>。
- 从目录导入BSON数据转储到MongoDB数据库
`mongorestore --db {{database_name}} {{path/to/directory}}`
- 从目录导入BSON数据转储到运行在指定端口的MongoDB服务器主机中的指定数据库并进行用户身份验证系统将提示用户输入密码
`mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/directory}} --password`
- 从BSON文件导入集合到MongoDB数据库
`mongorestore --db {{database_name}} {{path/to/file}}`
- 从BSON文件导入集合到运行在指定端口的MongoDB服务器主机中的指定数据库并进行用户身份验证系统将提示用户输入密码
`mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/file}} --password`