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
Merged

mongorestore: add page #1037

merged 8 commits into from Sep 5, 2016

Conversation

pdey
Copy link
Contributor

@pdey pdey commented Sep 4, 2016

No description provided.

@waldyrious waldyrious added the new command Issues requesting creation of a new page. label Sep 4, 2016
@waldyrious
Copy link
Member

Solid entry, nice work! The only thing I'd change is "containing bson data dump" --> "containing a bson data dump".


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

- Import database from folder containing a bson data dump:
Copy link
Member

Choose a reason for hiding this comment

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

The language can be improved a bit. Its not very clear that the data is being imported "to" the database. I would love a "from" -> "to" sentence. How about "Import a bson data dump from a folder to a given database" ?

@agnivade
Copy link
Member

agnivade commented Sep 4, 2016

A couple of points -

  1. We try to use the spelled out version of the flags of a command. https://github.com/tldr-pages/tldr/blob/master/CONTRIBUTING.md#guidelines. Lets keep it consistent with mongo and mongodump and use --host, --db etc.

  2. The same options are repeated again for the last example. The way we write these pages are introduce different options in different examples and let the user slowly build up the full command.
    So, I would suggest for the first example to drop the -h as that's used in all the following examples. Then introduce --host, --port in the 2nd one. After that, just --username in the 3rd one. Now we can have an example for a different use case, combining all the previous options. I would recommend also adding the --collection flag since we have space for some more examples.

    This is how I would build up the flags:

    1. --db
    2. --host, --port, --db
    3. --username, --db
    4. --host, --username, --port, --db (import from file)
    5. --collection, --db (import from folder, only to a particular collection)
    

@pdey
Copy link
Contributor Author

pdey commented Sep 5, 2016

Agree with most of the points. I feel --collection option for mongorestore need not be included here as it is rarely used ( such as collection name conflicts that will arise only if an exisiting database is merged with dump from another database).


- 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 😄

@agnivade
Copy link
Member

agnivade commented Sep 5, 2016

LGTM from my side. Over to @waldyrious for any final comments.


`mongorestore --db {{database_name}} {{path/to/folder}}`

- Import a bson data dump from a folder to a given mongodb database host running at a given port with user authentication; user will be prompted for password:
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit of a mouthful. We should harness punctuation to better guide reading flow, e.g.

- Import a bson data dump from a folder to a given mongodb database host, running at a given port, with user authentication (user will be prompted for password):

@waldyrious
Copy link
Member

waldyrious commented Sep 5, 2016

I've left some (mostly minor) inline comments. Additionally, I would suggest the "MongoDB" capitalization to be used in all descriptions, for correctness and to match the form used in the command summary.

@waldyrious
Copy link
Member

I'm happy with how the page turned out. Thanks again for a great contribution!

@waldyrious waldyrious merged commit 01759dc into tldr-pages:master Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command Issues requesting creation of a new page.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants