SharedOptions interface

Options that can be specified for a requested issued to the Azure Cosmos DB servers.=

Properties

abortSignal

abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController

Example

Cancel a read request

const controller = new AbortController()
const {result: item} = await items.query('SELECT * from c', { abortSignal: controller.signal});
controller.abort()
bypassIntegratedCache

Sets if integrated cache should be bypassed or enabled for the request in Azure CosmosDB service.

Default value is false. By default integrated cache is enabled

initialHeaders

(Advanced use case) Initial headers to start with when sending requests to Cosmos

maxIntegratedCacheStalenessInMs

Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the <xref:com.azure.cosmos.ConsistencyLevel> is <xref:com.azure.cosmos.ConsistencyLevel%23EVENTUAL> or <xref:com.azure.cosmos.ConsistencyLevel%23SESSION>, responses from the integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the consistency level is not set, this property is ignored.

Default value is null

Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.

priorityLevel

Priority Level (Low/High) for each request. Low priority requests are always throttled before any high priority requests.

Default value is null. By default all requests are of High priority

sessionToken

Enables/disables getting document container quota related stats for document container read requests.

Property Details

abortSignal

abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController

Example

Cancel a read request

const controller = new AbortController()
const {result: item} = await items.query('SELECT * from c', { abortSignal: controller.signal});
controller.abort()
abortSignal?: AbortSignal

Property Value

AbortSignal

bypassIntegratedCache

Sets if integrated cache should be bypassed or enabled for the request in Azure CosmosDB service.

Default value is false. By default integrated cache is enabled

bypassIntegratedCache?: boolean

Property Value

boolean

initialHeaders

(Advanced use case) Initial headers to start with when sending requests to Cosmos

initialHeaders?: CosmosHeaders

Property Value

maxIntegratedCacheStalenessInMs

Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the <xref:com.azure.cosmos.ConsistencyLevel> is <xref:com.azure.cosmos.ConsistencyLevel%23EVENTUAL> or <xref:com.azure.cosmos.ConsistencyLevel%23SESSION>, responses from the integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the consistency level is not set, this property is ignored.

Default value is null

Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.

maxIntegratedCacheStalenessInMs?: number

Property Value

number

priorityLevel

Priority Level (Low/High) for each request. Low priority requests are always throttled before any high priority requests.

Default value is null. By default all requests are of High priority

priorityLevel?: PriorityLevel

Property Value

sessionToken

Enables/disables getting document container quota related stats for document container read requests.

sessionToken?: string

Property Value

string