Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongorestore: add page #1037

Merged
merged 8 commits into from Sep 5, 2016
19 changes: 19 additions & 0 deletions pages/common/mongorestore.md
@@ -0,0 +1,19 @@
# mongorestore

> Utility to import a collection or database from a binary dump into a MongoDB instance.

- Import a bson data dump from a folder to a mongodb instance:

`mongorestore --host {{database_host}} --port {{port}} --db {{database_name}} {{path/to/folder}}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel --host and --port can be dropped here since they are anyways used in the next examples. Lets lay it slowly on the user 😄


- Import a bson data dump from a folder to a mongodb instance with user authentication; user will be prompted for password:

`mongorestore -h {{database_host:port}} -d {{database_name}} --username {{username}} {{path/to/folder}} --password`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expand the -h and -d flags. And also mention in the description that the data is going to be imported to a given database host running at a given port. We usually try to match the words in the description with the flags.


- Import a collection from a bson file to a mongodb instance:

`mongorestore --host {{database_host}} --port {{port}} --db {{database_name}} {{path/to/file}}`

- Import a collection from a bson file to a mongodb instance with user authentication; user will be prompted for password:

`mongorestore -h {{database_host:port}} -d {{database_name}} -u {{username}} {{path/to/file}} -p`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, please expand the -h, -d and -p flags.