property CosmosAdapterOptionsBase.containers
Since 0.2.0

Per-entity container, primary-key and partition-key overrides, keyed by the entity name passed to getRepository().

An entity with no entry uses its own name as the container and 'id' as the primary key, and its partition key is DISCOVERED from the container definition — which is both less to configure and safer, since a wrong partition key answers 404 rather than an error. A declared partitionKey is validated against the container and refused by name when it disagrees.

Examples

Example 1

new CosmosAdapter({
  endpoint,
  key,
  database: 'app',
  containers: { Order: { container: 'orders', partitionKey: 'tenantId' } },
});

Type

Readonly<Record<string, CosmosEntityMapping>>

Usage

import { type CosmosAdapterOptionsBase } from "database-plugin/src/index.ts";