Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Container

Operations for reading, replacing, or deleting a specific, existing container by id.

see

Containers for creating new containers, and reading/querying all containers; use .containers.

Note: all these operations make calls against a fixed budget. You should design your system such that these calls scale sublinearly with your application. For instance, do not call container(id).read() before every single item.read() call, to ensure the container exists; do this once on application start up.

Hierarchy

  • Container

Index

Properties

conflicts

conflicts: Conflicts

database

database: Database

The parent Database.

id

id: string

The id of the given container.

items

items: Items

Operations for creating new items, and reading/querying all items

For reading, replacing, or deleting an existing item, use .item(id).

example

Create a new item

const {body: createdItem} = await container.items.create({id: "<item id>", properties: {}});

storedProcedures

storedProcedures: StoredProcedures

Operations for creating new stored procedures, and reading/querying all stored procedures.

For reading, replacing, or deleting an existing stored procedure, use .storedProcedure(id).

triggers

triggers: Triggers

Operations for creating new triggers, and reading/querying all triggers.

For reading, replacing, or deleting an existing trigger, use .trigger(id).

userDefinedFunctions

userDefinedFunctions: UserDefinedFunctions

Operations for creating new user defined functions, and reading/querying all user defined functions.

For reading, replacing, or deleting an existing user defined function, use .userDefinedFunction(id).

Accessors

url

  • get url(): string

Methods

conflict

delete

extractPartitionKey

getPartitionKeyDefinition

item

  • item(id: string, partitionKey?: string): Item
  • Used to read, replace, or delete a specific, existing Item by id.

    Use .items for creating new items, or querying/reading all items.

    example

    Replace an item const {body: replacedItem} = await container.item("").replace({id: "", title: "Updated post", authorID: 5});

    Parameters

    • id: string

      The id of the Item.

    • Optional partitionKey: string

      The partition key of the Item. (Required for partitioned containers).

    Returns Item

read

replace

storedProcedure

trigger

userDefinedFunction

Generated using TypeDoc