<commit_before># Manage CouchDB: Common management and maintenance

Manage CouchDB is a Couch app ("design document") to do all the common stuff we all need.

It has identical implementations in **JavaScript** (for clarity and portability) and **Erlang** (for performance). Both implementations pass the same test suite.

Just drop it in your database (the id is `_design/couchdb` for JavaScript, and `_design/ecouchdb` for Erlang) to get several features.

## A view of all conflicts

Hit `.../_view/conflicts` to see all conflicts in the database.

* Use `?group_level=1` to get a conflict count for each document
* Use `?reduce=false` to get one row per `[id,revision]` pair.
* Use `?reduce=false&include_docs=true` to get every conflicted revision in one big batch.

## Some useful rewrites

Manage CouchDB includes some simple rewrites if you want to build from it.

* `/_rewrite/_couchdb` hits the root CouchDB API
* `/_rewrite/_db` hits the current database
* `/_rewrite/_ddoc` hits the manage_couchdb design document itself

## An easy-to-use validation function

To make a database read-only, edit this design document (e.g. `_design/couchdb`), and set `.access.read_only` = **true**.<commit_msg>Tighten the README slightly<commit_after># Manage CouchDB: Common management and maintenance

Manage CouchDB is a Couch app ("design document") to do all the common stuff we all need.

It has identical implementations in **JavaScript** (for clarity and portability) and **Erlang** (for performance). Both implementations pass the same test suite.

Just drop it in your database (the id is `_design/couchdb` for JavaScript, and `_design/ecouchdb` for Erlang) to get several features.

## A view of all conflicts

Hit `/_view/conflicts` to see all conflicts in the database.

* Use `?group_level=1` to get a conflict count for each document
* Use `?reduce=false` to get one row per `[id,revision]` pair.
* Use `?reduce=false&include_docs=true` to get every conflicted revision in one big batch.

## Some useful rewrites

Manage CouchDB includes some simple rewrites if you want to build from it.

* `/_rewrite/_couchdb` hits the root CouchDB API
* `/_rewrite/_db` hits the current database
* `/_rewrite/_ddoc` hits the manage_couchdb design document itself

## An easy validation function

To make a database read-only, edit this design document (e.g. `_design/couchdb`), and set `.access.read_only` = **true**.
{'fraction_non_alphanumeric': 0.08906379453189726, 'fraction_numerical': 0.0008285004142502071, 'mean_word_length': 4.709219858156028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2692327', 'n_tokens_mistral': 714, 'n_tokens_neox': 705, 'n_words': 326}