interface ICosmosItems
Since 0.2.0

A structural subset of the SDK Items collection — the members the data source drives.

Methods

create(body: Record<string, unknown>): Promise<CosmosItemResponse<Record<string, unknown>>>

Inserts one document, refusing a duplicate id within the partition.

query(spec: CosmosQuerySpec): ICosmosQueryIterator<Record<string, unknown>>

Runs a parameterized SQL query across the container.

batch(
operations: readonly CosmosBatchOperation[],
): Promise<CosmosBatchResponse>

Runs a transactional batch, atomic within one partition-key value.

Usage

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