property CosmosEntityMapping.partitionKey

The document field path(s) carrying the partition key.

Absent, the adapter discovers it from the container definition, which is both cheaper for the developer and safer: a wrong partition key is a silent 404 rather than an error. When present it is VALIDATED against the container definition, so a mistyped path is refused by name at first use.

A nested path is written as an array (['address', 'city']); a hierarchical (MultiHash) partition key is written as an array of paths.

Type

string | readonly string[] | readonly (readonly string[])[]

Usage

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