FSharp.Azure.Cosmos 1.0.0

Edit this page

Upsert Module

Types and nested modules

Type/Module Description

CosmosException

UpsertBuilder<'T>

UpsertConcurrentResult<'t, 'E>

Represents the result of an upsert operation.

UpsertConcurrentlyBuilder<'T, 'E>

UpsertConcurrentlyOperation<'T, 'E>

UpsertOperation<'T>

UpsertResult<'t>

Represents the result of an upsert operation.

Functions and values

Function or value Description

DefaultMaxRetryCount

Full Usage: DefaultMaxRetryCount

Returns: int
Returns: int

executeConcurrentlyAsync ct container operation retryAttempts

Full Usage: executeConcurrentlyAsync ct container operation retryAttempts

Parameters:
Returns: Task<CosmosResponse<UpsertConcurrentResult<'value, 'error>>>
ct : CancellationToken
container : Container
operation : UpsertConcurrentlyOperation<'value, 'error>
retryAttempts : int
Returns: Task<CosmosResponse<UpsertConcurrentResult<'value, 'error>>>

upsert

Full Usage: upsert

Returns: UpsertBuilder<'T>
Returns: UpsertBuilder<'T>

upsertAndRead

Full Usage: upsertAndRead

Returns: UpsertBuilder<'T>
Returns: UpsertBuilder<'T>

upsertConcurrenly

Full Usage: upsertConcurrenly

Returns: UpsertConcurrentlyBuilder<'T, 'E>
Returns: UpsertConcurrentlyBuilder<'T, 'E>

upsertConcurrenlyAndRead

Full Usage: upsertConcurrenlyAndRead

Returns: UpsertConcurrentlyBuilder<'T, 'E>
Returns: UpsertConcurrentlyBuilder<'T, 'E>

Type extensions

Type extension Description

this.ExecuteAsync

Full Usage: this.ExecuteAsync

Parameters:
Returns: Task<CosmosResponse<UpsertResult<'T>>>

Executes an upsert operation safely and returns CosmosResponse{UpsertResult{T}}.

Requires ETag to be set in ItemRequestOptions.

Extended Type: Container

operation : UpsertOperation<'T>

Upsert operation.

cancellationToken : CancellationToken

Cancellation token.

Returns: Task<CosmosResponse<UpsertResult<'T>>>

this.ExecuteConcurrentlyAsync

Full Usage: this.ExecuteConcurrentlyAsync

Parameters:
Returns: Task<CosmosResponse<UpsertConcurrentResult<'T, 'E>>>

Executes an upsert operation by applying change to item if exists and returns CosmosResponse{UpsertConcurrentResult{T, E}}.

Extended Type: Container

operation : UpsertConcurrentlyOperation<'T, 'E>

Upsert operation.

maxRetryCount : int

Max retry count. Default is 10.

cancellationToken : CancellationToken

Cancellation token.

Returns: Task<CosmosResponse<UpsertConcurrentResult<'T, 'E>>>

this.ExecuteConcurrentlyAsync

Full Usage: this.ExecuteConcurrentlyAsync

Parameters:
Returns: Task<CosmosResponse<UpsertConcurrentResult<'T, 'E>>>

Executes an upsert operation by applying change to item if exists and returns CosmosResponse{UpsertConcurrentResult{T, E}}.

Extended Type: Container

operation : UpsertConcurrentlyOperation<'T, 'E>

Upsert operation.

cancellationToken : CancellationToken

Cancellation token.

Returns: Task<CosmosResponse<UpsertConcurrentResult<'T, 'E>>>

this.ExecuteOverwriteAsync

Full Usage: this.ExecuteOverwriteAsync

Parameters:
Returns: Task<CosmosResponse<'Result>>

Executes a upsert operation, transforms success or failure, and returns CosmosResponse{T}.

Extended Type: Container

operation : UpsertOperation<'T>

Upsert operation

succsess : 'T -> 'Result
failure : CosmosException -> 'Result

Error transform if failure

cancellationToken : CancellationToken

Cancellation token

Returns: Task<CosmosResponse<'Result>>

this.ExecuteOverwriteAsync

Full Usage: this.ExecuteOverwriteAsync

Parameters:
Returns: Task<CosmosResponse<UpsertResult<'T>>>

Executes an upsert operation replacing existing item if it exists and returns CosmosResponse{UpsertResult{T}}.

Extended Type: Container

operation : UpsertOperation<'T>

Upsert operation.

cancellationToken : CancellationToken

Cancellation token.

Returns: Task<CosmosResponse<UpsertResult<'T>>>

this.PlainExecuteAsync

Full Usage: this.PlainExecuteAsync

Parameters:
Returns: Task<ItemResponse<'T>>

Executes an upsert operation and returns ItemResponse{T}.

Extended Type: Container

operation : UpsertOperation<'T>

Upsert operation.

cancellationToken : CancellationToken

Cancellation token.

Returns: Task<ItemResponse<'T>>