<commit_before># Bootstrap

If you are familiar with *express* and/or *mongoose* you know that they do not
have special setup routines (most of the time). For example, *mongoose* will
establish a *connection* to the database and queue your queries until the
connection is ready.

This library is doing the same, except it queues complete requests. Starting
with *v7* of this library, *waterline* is used as persistence abstraction layer.
*Waterline* requires you to load all collections before you can use them.

## Waterline

This example shows a common waterline setup:

```js
const waterline = new Waterline()

waterline.loadCollection(collection)
waterline.initialize(config, (err, ontology) => {
  …
})
```

## Library

With this library, you do things more or less the same, except invoking
`initialize` yourself.

```js
const waterline = new Waterline()

waterline.loadCollection(collection)

api({db: waterline})
  .plugin(…)
```

The library invokes `initialize` once and will fullfill all potential request
promises on a successfull connect. If there a error on connect, the application
will crash.

There are also a set of default collections that are loaded (user management, …)
during this process.
<commit_msg>docs: update db init section<commit_after># Bootstrap

If you are familiar with *express* and/or *mongoose* you know that they do not
have special setup routines (most of the time). For example, *mongoose* will
establish a *connection* to the database and queue your queries until the
connection is ready.

This library is doing the same, except it queues complete requests. Starting
with *v7* of this library, *waterline* is used as persistence abstraction layer.
*Waterline* requires you to load all collections before you can use them.

## Waterline

This example shows a common waterline setup:

```js
const waterline = new Waterline()

waterline.loadCollection(collection)
waterline.initialize(config, (err, ontology) => {
  …
})
```

## Library

With this library, you do things more or less the same, except invoking
`initialize` yourself.

```js
const waterline = new Waterline()

db.load(collection)

app.use(db.init(config)}
```

The library invokes `initialize` once and will fullfill all potential request
promises on a successfull connect. If there is an error on connect, the
application will throw an error.

{'fraction_non_alphanumeric': 0.07711972731146144, 'fraction_numerical': 0.0008521516829995739, 'mean_word_length': 4.929292929292929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1153792', 'n_tokens_mistral': 644, 'n_tokens_neox': 622, 'n_words': 318}