Package version:

Interface RequestOptions

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

interface RequestOptions {
    abortSignal?: AbortSignal;
    accessCondition?: {
        condition: string;
        type: string;
    };
    bypassIntegratedCache?: boolean;
    consistencyLevel?: string;
    disableAutomaticIdGeneration?: boolean;
    disableRUPerMinuteUsage?: boolean;
    enableScriptLogging?: boolean;
    indexingDirective?: string;
    initialHeaders?: CosmosHeaders;
    maxIntegratedCacheStalenessInMs?: number;
    offerThroughput?: number;
    offerType?: string;
    populateQuotaInfo?: boolean;
    postTriggerInclude?: string | string[];
    preTriggerInclude?: string | string[];
    priorityLevel?: PriorityLevel;
    resourceTokenExpirySeconds?: number;
    sessionToken?: string;
    throughputBucket?: number;
    urlConnection?: string;
}

Hierarchy (view full)

Properties

abortSignal?: 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

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

Conditions Associated with the request.

Type declaration

  • condition: string

    Conditional HTTP method header value (the _etag field from the last version you read).

  • type: string

    Conditional HTTP method header type (IfMatch or IfNoneMatch).

bypassIntegratedCache?: boolean

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

consistencyLevel?: string

Consistency level required by the client.

disableAutomaticIdGeneration?: boolean

Disable automatic id generation (will cause creates to fail if id isn't on the definition)

disableRUPerMinuteUsage?: boolean

DisableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity to serve the request if regular provisioned RUs/second is exhausted.

enableScriptLogging?: boolean

Enables or disables logging in JavaScript stored procedures.

indexingDirective?: string

Specifies indexing directives (index, do not index .. etc).

initialHeaders?: CosmosHeaders

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

maxIntegratedCacheStalenessInMs?: number

Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the com.azure.cosmos.ConsistencyLevel is com.azure.cosmos.ConsistencyLevel#EVENTUAL or com.azure.cosmos.ConsistencyLevel#SESSION, 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.

offerThroughput?: number

The offer throughput provisioned for a container in measurement of Requests-per-Unit.

offerType?: string

Offer type when creating document containers.

This option is only valid when creating a document container.

populateQuotaInfo?: boolean

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

postTriggerInclude?: string | string[]

Indicates what is the post trigger to be invoked after the operation.

preTriggerInclude?: string | string[]

Indicates what is the pre trigger to be invoked before the operation.

priorityLevel?: 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

resourceTokenExpirySeconds?: number

Expiry time (in seconds) for resource token associated with permission (applicable only for requests on permissions).

sessionToken?: string

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

throughputBucket?: number

Throughput Bucket for a request.

Default value is null. In this case, the request can use 100% of the partition throughput.

For more information, visit [Cosmos DB throughput Bucketing](https://aka.ms/cosmsodb-bucketing).
urlConnection?: string

(Advanced use case) The url to connect to.