Package version:

Class Database

Operations for reading or deleting an existing database.

Databases for creating new databases, and reading/querying all databases; use client.databases.

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 database.read() before every single item.read() call, to ensure the database exists; do this once on application start up.

Constructors

Properties

Accessors

Methods

Constructors

Properties

client: CosmosClient
containers: Containers

Used for creating new containers, or querying/reading all containers.

Use .database(id) to read, replace, or delete a specific, existing Database by id.

const {body: containerDefinition, container} = await client.database("<db id>").containers.create({id: "<container id>"});
id: string
users: Users

Used for creating new users, or querying/reading all users.

Use .user(id) to read, replace, or delete a specific, existing User by id.

Accessors

Methods