Containers class

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

Constructors

Containers(Database, ClientContext)

Properties

database

Methods

create(ContainerRequest, RequestOptions)

Creates a container. A container is a named logical container for items.

A database may contain zero or more named containers and each container consists of zero or more JSON items.

Being schema-free, the items in a container do not need to share the same structure or fields.

Since containers are application resources, they can be authorized using either the master key or resource keys.

createIfNotExists(ContainerRequest, RequestOptions)

Checks if a Container exists, and, if it doesn't, creates it. This will make a read operation based on the id in the body, then if it is not found, a create operation. You should confirm that the output matches the body you passed in for non-default properties (i.e. indexing policy/etc.) A container is a named logical container for items.

A database may contain zero or more named containers and each container consists of zero or more JSON items.

Being schema-free, the items in a container do not need to share the same structure or fields.

Since containers are application resources, they can be authorized using either the master key or resource keys.

query(SqlQuerySpec, FeedOptions)

Queries all containers.

query(SqlQuerySpec, FeedOptions)

Queries all containers.

readAll(FeedOptions)

Read all containers.

Constructor Details

Containers(Database, ClientContext)

new Containers(database: Database, clientContext: ClientContext)

Parameters

database
Database
clientContext
ClientContext

Property Details

database

database: Database

Property Value

Method Details

create(ContainerRequest, RequestOptions)

Creates a container. A container is a named logical container for items.

A database may contain zero or more named containers and each container consists of zero or more JSON items.

Being schema-free, the items in a container do not need to share the same structure or fields.

Since containers are application resources, they can be authorized using either the master key or resource keys.

function create(body: ContainerRequest, options?: RequestOptions)

Parameters

body
ContainerRequest

Represents the body of the container.

options
RequestOptions

Use to set options like response page size, continuation tokens, etc.

Returns

createIfNotExists(ContainerRequest, RequestOptions)

Checks if a Container exists, and, if it doesn't, creates it. This will make a read operation based on the id in the body, then if it is not found, a create operation. You should confirm that the output matches the body you passed in for non-default properties (i.e. indexing policy/etc.) A container is a named logical container for items.

A database may contain zero or more named containers and each container consists of zero or more JSON items.

Being schema-free, the items in a container do not need to share the same structure or fields.

Since containers are application resources, they can be authorized using either the master key or resource keys.

function createIfNotExists(body: ContainerRequest, options?: RequestOptions)

Parameters

body
ContainerRequest

Represents the body of the container.

options
RequestOptions

Use to set options like response page size, continuation tokens, etc.

Returns

query(SqlQuerySpec, FeedOptions)

Queries all containers.

function query(query: SqlQuerySpec, options?: FeedOptions)

Parameters

query
SqlQuerySpec

Query configuration for the operation. See <xref:SqlQuerySpec> for more info on how to configure a query.

options
FeedOptions

Use to set options like response page size, continuation tokens, etc.

Returns

query(SqlQuerySpec, FeedOptions)

Queries all containers.

function query<T>(query: SqlQuerySpec, options?: FeedOptions)

Parameters

query
SqlQuerySpec

Query configuration for the operation. See <xref:SqlQuerySpec> for more info on how to configure a query.

options
FeedOptions

Use to set options like response page size, continuation tokens, etc.

Returns

readAll(FeedOptions)

Read all containers.

function readAll(options?: FeedOptions)

Parameters

options
FeedOptions

Use to set options like response page size, continuation tokens, etc.

Returns

QueryIterator<Resource>