prorm API Reference
    Preparing search index...

    Class CosmosDbStore

    Base interface for NoSQL stores.

    NoSQL engines (document stores, key-value caches, partition-key stores) do not share the SQL-shaped Dialect interface (no query(sql), no identifier escaping, no DDL). NoSqlStore is intentionally minimal: connection lifecycle plus a raw escape hatch. Each store's real API surface (find/insert/update for Mongo, hash/list/set ops for Redis, item CRUD for DynamoDB) lives on its own class, not on this interface, because forcing them into one shared query shape would misrepresent what each engine can actually do.

    Implements

    Index
    name: "cosmosdb" = 'cosmosdb'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@azure/cosmos" = '@azure/cosmos'

    The client library being used

    • Resolves a container handle via database(db).container(container).

      Parameters

      • Optionalcontainer: string
      • Optionaldatabase: string

      Returns any

    • Create a document; returns its id.

      Parameters

      • collection: string
      • doc: Record<string, unknown>

      Returns Promise<unknown>

    • Read a document by id, returning its stored resource.

      Parameters

      • collection: string
      • id: string

      Returns Promise<unknown>

    • Merge patch into the existing document and replace it.

      Parameters

      • collection: string
      • id: string
      • patch: Record<string, unknown>

      Returns Promise<unknown>

    • Delete a document by id.

      Parameters

      • collection: string
      • id: string

      Returns Promise<unknown>

    • Run a Cosmos SQL query (string or SqlQuerySpec) against collection and return the matched resources.

      Parameters

      • collection: string
      • statement: unknown
      • options: CosmosDbQueryOptions = {}

      Returns Promise<unknown[]>