> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/api-reference/database.md).

# Database

Database — REST API reference.

The Database module gives your project a schema-driven data layer on top of MongoDB — structured schemas, a full CRUD + query API, record-level triggers, and multi-tenant isolation. You host MongoDB; Norbix owns the schema layer and API surface.

{% content-ref url="/pages/Szm3Z2jlu2erKhzioKCg" %}
[Aggregates](/codemash/api-reference/database/aggregates.md)
{% endcontent-ref %}

{% content-ref url="/pages/YtyuOuXSKW3vG2gGjVTz" %}
[Collections](/codemash/api-reference/database/collections.md)
{% endcontent-ref %}

{% content-ref url="/pages/pAFauvNTAKLreftuWLxw" %}
[Integrations](/codemash/api-reference/database/integrations.md)
{% endcontent-ref %}

{% content-ref url="/pages/GCy8Q0VZu5ECCEpbxQsI" %}
[Module](/codemash/api-reference/database/module.md)
{% endcontent-ref %}

{% content-ref url="/pages/JtQ3jJKeDE7xCmWxoPM5" %}
[Schemas](/codemash/api-reference/database/schemas.md)
{% endcontent-ref %}

{% content-ref url="/pages/5I9Q0lm20gZlihQ3qqpm" %}
[Taxonomies](/codemash/api-reference/database/taxonomies.md)
{% endcontent-ref %}

## Rules worth knowing

* The **Hub** (developer / admin plane) and the **API** (data plane, for apps) share the record routes; schemas, taxonomies, triggers, aggregates and integrations are managed on the Hub.
* Record filters and pipelines refuse `$where`, `$function`, `$accumulator`, and read pipelines refuse `$out` / `$merge` — error `CM-ERRORS-DATABASE-031`.
* `Update One` / `Update Many` are validated against the published schema, like inserts, and take bare fields only — a top-level `$` operator is refused (`CM-ERRORS-DATABASE-035`).
* `Update Many` / `Delete Many` refuse an empty filter unless `allRecords: true` is sent (`CM-ERRORS-DATABASE-037`); soft-deleted records are never written; own-scope callers may use the bulk operations on their own records. Full list: [Rules for every record endpoint](/codemash/api-reference/database/collections.md#rules-for-every-record-endpoint).

How-to pages: [Cloud → Database](/codemash/cloud/database.md). AI tools: [What agents can do](/codemash/ai/developers/what-agents-can-do.md).
