<commit_before>
            ┌───────────────────────────────────────────────────────────────────────────────────┐
            │           __  ___                           __  __           __                   │
            │          /  |/  /___  ____  ____ _____     / / / /___ ______/ /_____  _____       │
            │         / /|_/ / __ \/ __ \/ __ `/ __ \   / /_/ / __ `/ ___/ //_/ _ \/ ___/       │
            │        / /  / / /_/ / / / / /_/ / /_/ /  / __  / /_/ / /__/ ,< /  __/ /           │
            │       /_/  /_/\____/_/ /_/\__, /\____/  /_/ /_/\__,_/\___/_/|_|\___/_/            │
            │                          /____/                                                   │
            └───────────────────────────────────────────────────────────────────────────────────┘

# MongoDB Shell Enhancements

## Warnings

* These enhancements are useful to me but they don't make sense for everyone. Feel free to tweak to your desire and please submit [feedback or pull requests](https://github.com/TylerBrock/mongo-hacker/issues).
* Does not work with `mongo` shell or MongoDB servers < 2.4
* Updates called on existing cursors are new and experimental (see notes in API section)

## Installation

```sh
npm install -g mongo-hacker
```


#### Install from source
```
git clone https://github.com/TylerBrock/mongo-hacker
cd mongo-hacker
make install
cd ..
rm -rdf mongo-hacker/
```

## Enhancements

#### Basic UX

  - Sort document keys by default
  - Highlight querytime if verboseShell is enabled
    - In **green** if querytime is at or below slowms
    - In **red** if query time is above slowms
  - Default indent is 2 spaces instead of tab
    - Customizable by setting `indent` key of config
  - Verbose shell is enabled by default -- to disable: `setVerboseShell(false)`
  - Disable notfication of "Type 'it' for more"
  - Custom prompt: `hostname(process-version)[rs_status:set_name] db>`
  - Always pretty print. You can still use default format by appending `.ugly()` to the end of db statement.
  - Show DBs has aligned columns, is sorted by database name and shows less significant digits (in master for Mongo 2.5/2.6)
  - Nicer `sh.status()` output (remove lastmod, take up less space, colorize chunk's shard)
  - Colorized query output for console/terminal windows supporting ANSI color codes.
    ![Colorized Output](http://tylerbrock.github.com/mongo-hacker/screenshots/colorized_shell.png)

#### Additional shell commands

The MongoDB shell offers various "shell commands" _(sometimes referred to as "shell helpers" as well)_ that make interactive use of the shell much more convenient than [proper, Javascript-only scripted use of the shell][interactive_versus_scripted].<commit_msg>Mention verbose shell earlier; remove custom `sh.status()`<commit_after>
            ┌───────────────────────────────────────────────────────────────────────────────────┐
            │           __  ___                           __  __           __                   │
            │          /  |/  /___  ____  ____ _____     / / / /___ ______/ /_____  _____       │
            │         / /|_/ / __ \/ __ \/ __ `/ __ \   / /_/ / __ `/ ___/ //_/ _ \/ ___/       │
            │        / /  / / /_/ / / / / /_/ / /_/ /  / __  / /_/ / /__/ ,< /  __/ /           │
            │       /_/  /_/\____/_/ /_/\__, /\____/  /_/ /_/\__,_/\___/_/|_|\___/_/            │
            │                          /____/                                                   │
            └───────────────────────────────────────────────────────────────────────────────────┘

# MongoDB Shell Enhancements

## Warnings

* These enhancements are useful to me but they don't make sense for everyone. Feel free to tweak to your desire and please submit [feedback or pull requests](https://github.com/TylerBrock/mongo-hacker/issues).
* Does not work with `mongo` shell or MongoDB servers < 2.4
* Updates called on existing cursors are new and experimental (see notes in API section)

## Installation

```sh
npm install -g mongo-hacker
```


#### Install from source
```
git clone https://github.com/TylerBrock/mongo-hacker
cd mongo-hacker
make install
cd ..
rm -rdf mongo-hacker/
```

## Enhancements

#### Basic UX

  - Sort document keys by default
  - Verbose shell is enabled by default -- to disable: `setVerboseShell(false)`
  - Highlight querytime if verboseShell is enabled
    - In **green** if querytime is at or below slowms
    - In **red** if query time is above slowms
  - Default indent is 2 spaces instead of tab
    - Customizable by setting `indent` key of config
  - Disable notification of "Type 'it' for more"
  - Custom prompt: `hostname(process-version)[rs_status:set_name] db>`
  - Always pretty print. You can still use default format by appending `.ugly()` to the end of a statement.
  - Colorized query output for console/terminal windows supporting ANSI color codes.
    ![Colorized Output](http://tylerbrock.github.com/mongo-hacker/screenshots/colorized_shell.png)

#### Additional shell commands

The MongoDB shell offers various "shell commands" _(sometimes referred to as "shell helpers" as well)_ that make interactive use of the shell much more convenient than [proper, Javascript-only scripted use of the shell][interactive_versus_scripted].
{'fraction_non_alphanumeric': 0.1667298219022357, 'fraction_numerical': 0.0018946570670708603, 'mean_word_length': 2.1347980997624703, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1127787', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1501, 'n_words': 481}