Skip to content

Commit

Permalink
docs: Update adapter documentation (#3249)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-steel authored Aug 8, 2023
1 parent 0d30434 commit aea8d1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
12 changes: 6 additions & 6 deletions docs/api/databases/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ app.use('/messages', new NameService({ id, events, paginate }))

The following options are available for all database adapters:

- `id` (_optional_) - The name of the id field property (usually set by default to `id` or `_id`).
- `paginate` (_optional_) - A [pagination object](#pagination) containing a `default` and `max` page size
- `multi` (_optional_, default: `false`) - Allow `create` with arrays and `patch` and `remove` with id `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)
- `id {string}` (_optional_) - The name of the id field property (usually set by default to `id` or `_id`).
- `paginate {Object}` (_optional_) - A [pagination object](#pagination) containing a `default` and `max` page size
- `multi {string[]|boolean}` (_optional_, default: `false`) - Allow `create` with arrays and `patch` and `remove` with id `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)

The following legacy options are still available but should be avoided:

- `events` (_optional_, **deprecated**) - A list of [custom service events](../events.md#custom-events) sent by this service. Use the `events` option when [registering the service with app.use](../application.md#usepath-service--options) instead.
- `operators` (_optional_, **deprecated**) - A list of additional non-standard query parameters to allow (e.g `[ '$regex' ]`). Not necessary when using a [query schema](../schema/validators.md#validatequery)
- `filters` (_optional_, **deprecated**) - A list of top level `$` query parameters to allow (e.g. `[ '$populate' ]`). Not necessary when using a [query schema](../schema/validators.md#validatequery)
- `events {string[]}` (_optional_, **deprecated**) - A list of [custom service events](../events.md#custom-events) sent by this service. Use the `events` option when [registering the service with app.use](../application.md#usepath-service--options) instead.
- `operators {string[]}` (_optional_, **deprecated**) - A list of additional non-standard query parameters to allow (e.g `[ '$regex' ]`). Not necessary when using a [query schema](../schema/validators.md#validatequery)
- `filters {Object}` (_optional_, **deprecated**) - An object of additional top level query filters, e.g. `{ $populate: true }`. Can also be a converter function like `{ $ignoreCase: (value) => value === 'true' ? true : false }`. Not necessary when using a [query schema](../schema/validators.md#validatequery)

For database specific options see the adapter documentation.

Expand Down
9 changes: 5 additions & 4 deletions docs/api/databases/knex.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ The Knex specific adapter options are:

The [common API options](./common.md#options) are:

- `id {string}` (_optional_, default: `'_id'`) - The name of the id field property. By design, MongoDB will always add an `_id` property.
- `events {string[]}` (_optional_) - A list of [custom service events](/api/events.html#custom-events) sent by this service
- `paginate {Object}` (_optional_) - A [pagination object](/api/databases/common.html#pagination) containing a `default` and `max` page size
- `multi {string[]|true}` (_optional_) - Allow `create` with arrays and `update` and `remove` with `id` `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)
- `id {string}` (_optional_, default: `'id'`) - The name of the id field property. By design, Knex will always add an `id` property.
- `paginate {Object}` (_optional_) - A [pagination object](#pagination) containing a `default` and `max` page size
- `multi {string[]|boolean}` (_optional_, default: `false`) - Allow `create` with arrays and `patch` and `remove` with id `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)

There are additionally several legacy options in the [common API options](./common.md#options)

### getModel([params])

Expand Down
8 changes: 5 additions & 3 deletions docs/api/databases/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ MongoDB adapter specific options are:
The [common API options](./common.md#options) are:

- `id {string}` (_optional_, default: `'_id'`) - The name of the id field property. By design, MongoDB will always add an `_id` property.
- `events {string[]}` (_optional_) - A list of [custom service events](/api/events.html#custom-events) sent by this service
- `paginate {Object}` (_optional_) - A [pagination object](/api/databases/common.html#pagination) containing a `default` and `max` page size
- `multi {string[]|true}` (_optional_) - Allow `create` with arrays and `update` and `remove` with `id` `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)
- `id {string}` (_optional_) - The name of the id field property (usually set by default to `id` or `_id`).
- `paginate {Object}` (_optional_) - A [pagination object](#pagination) containing a `default` and `max` page size
- `multi {string[]|boolean}` (_optional_, default: `false`) - Allow `create` with arrays and `patch` and `remove` with id `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)

There are additionally several legacy options in the [common API options](./common.md#options)

### getModel()

Expand Down

0 comments on commit aea8d1c

Please sign in to comment.