FSharp.Azure.Cosmos 1.2.0

Edit this page

Operations Module

Type extensions

Type extension Description

this.AddPostTrigger

Full Usage: this.AddPostTrigger

Parameters:
    trigger : string

Extended Type: ItemRequestOptions

trigger : string

this.AddPostTriggers

Full Usage: this.AddPostTriggers

Parameters:
    triggers : string seq - Trigger names.

Adds post-triggers to request options.

Extended Type: ItemRequestOptions

triggers : string seq

Trigger names.

ArgumentNullException Thrown when triggers is .

this.AddPreTrigger

Full Usage: this.AddPreTrigger

Parameters:
    trigger : string - Trigger name.

Adds a pre-trigger to request options.

Extended Type: ItemRequestOptions

trigger : string

Trigger name.

this.AddPreTriggers

Full Usage: this.AddPreTriggers

Parameters:
    triggers : string seq - Trigger names.

Adds pre-triggers to request options.

Extended Type: ItemRequestOptions

triggers : string seq

Trigger names.

ArgumentNullException Thrown when triggers is .

this.CountAsync

Full Usage: this.CountAsync

Parameters:
Returns: Task<int>

Counts the number of items in the container with specified QueryRequestOptions.

Extended Type: Container

requestOptions : QueryRequestOptions

Request options

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int>

this.CountAsync

Full Usage: this.CountAsync

Parameters:
Returns: Task<int>

Counts the number of items in the container partition with specified key.

If no partition key is provided, the count will be for the entire container.

Extended Type: Container

partitionKey : Nullable<PartitionKey>

Partition key

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int>

this.CountAsync

Full Usage: this.CountAsync

Parameters:
    partitionKey : string - Partition key
    cancellationToken : CancellationToken - Cancellation token

Returns: Task<int>

Counts the number of items in the container partition with specified key.

If no partition key is provided, the count will be for the entire container.

Extended Type: Container

partitionKey : string

Partition key

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int>

this.ExistsAsync

Full Usage: this.ExistsAsync

Parameters:
Returns: Task<bool>

Checks if an item with specified Id exists in the container.

Without a requestOptions partition key, the query spans every partition: the same Id can exist in more than one logical partition, so any positive count is treated as a match.

Extended Type: Container

id : string

Item Id

requestOptions : QueryRequestOptions

Request options

cancellationToken : CancellationToken

Cancellation token

Returns: Task<bool>

this.ExistsAsync

Full Usage: this.ExistsAsync

Parameters:
    id : string - Item Id
    partitionKey : PartitionKey - Full partition key, or a prefix of a hierarchical partition key
    cancellationToken : CancellationToken - Cancellation token

Returns: Task<bool>

Checks if an item with specified Id exists in the container partition with specified key.

A full partition key and an Id identify at most one item, so the check is a point read: it is exact, and its request charge depends only on the item size and the consistency level (1 RU for a 1 KB item, twice as much with strong or bounded staleness consistency).

A prefix of a hierarchical partition key cannot be point-read; the service rejects it as a bad request, and the check falls back to a query scoped to that prefix, matching the Id anywhere beneath it.

Extended Type: Container

id : string

Item Id

partitionKey : PartitionKey

Full partition key, or a prefix of a hierarchical partition key

cancellationToken : CancellationToken

Cancellation token

Returns: Task<bool>
CosmosException Thrown when the check fails for a reason other than the item not existing, for example throttling, authorization or a missing container.

this.IsNotDeletedAsync

Full Usage: this.IsNotDeletedAsync

Parameters:
    deletedFieldName : string - Name of the item field that marks the item as deleted.
    id : string - Item Id
    requestOptions : QueryRequestOptions - Query request options, for example to scope the query to a partition key.
    cancellationToken : CancellationToken - Cancellation token

Returns: Task<bool> true when the item exists and is not marked as deleted; otherwise false.

Checks whether an item with the specified Id exists and is not marked as deleted.

The item is treated as not deleted when the deletedFieldName field is absent, , or false. Any other value, such as true or a deletion timestamp, marks the item as deleted.

Extended Type: Container

deletedFieldName : string

Name of the item field that marks the item as deleted.

id : string

Item Id

requestOptions : QueryRequestOptions

Query request options, for example to scope the query to a partition key.

cancellationToken : CancellationToken

Cancellation token

Returns: Task<bool>

true when the item exists and is not marked as deleted; otherwise false.

ArgumentNullException Thrown when deletedFieldName is .
ArgumentException Thrown when deletedFieldName does not start with a letter or underscore, or contains characters other than letters, digits, or underscores.

this.LongCountAsync

Full Usage: this.LongCountAsync

Parameters:
Returns: Task<int64>

Counts the number of items in the container with specified QueryRequestOptions.

Extended Type: Container

requestOptions : QueryRequestOptions

Request options

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int64>

this.LongCountAsync

Full Usage: this.LongCountAsync

Parameters:
Returns: Task<int64>

Counts the number of items in the container partition with specified key.

If no partition key is provided, the count will be for the entire container.

Extended Type: Container

partitionKey : Nullable<PartitionKey>

Partition key

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int64>

this.LongCountAsync

Full Usage: this.LongCountAsync

Parameters:
    partitionKey : string - Partition key
    cancellationToken : CancellationToken - Cancellation token

Returns: Task<int64>

Counts the number of items in the container partition with specified key.

If no partition key is provided, the count will be for the entire container.

Extended Type: Container

partitionKey : string

Partition key

cancellationToken : CancellationToken

Cancellation token

Returns: Task<int64>

this.SubStatusCode

Full Usage: this.SubStatusCode

Parameters:
    () : unit

Returns: int

Gets the Cosmos DB sub-status code of the response, or 0 when the response has none.

C# callers use GetSubStatusCode instead, since F# extension properties are not visible to C#.

Extended Type: ResponseMessage

() : unit
Returns: int

this.SubStatusCode

Full Usage: this.SubStatusCode

Returns: int

Gets the Cosmos DB sub-status code of the response, or 0 when the response has none.

C# callers use GetSubStatusCode instead, since F# extension properties are not visible to C#.

Extended Type: ResponseMessage

Returns: int

Active patterns

Active pattern Description

(|CosmosException|_|) ex

Full Usage: (|CosmosException|_|) ex

Parameters:
Returns: CosmosException voption
ex : Exception
Returns: CosmosException voption

(|HandleException|_|) ex

Full Usage: (|HandleException|_|) ex

Parameters:
Returns: CosmosException voption
ex : Exception
Returns: CosmosException voption