CouchbaseBucket.UpsertAsync<T> Method (String, T, UInt64, UInt32)Couchbase .NET SDK 2.3.3
Inserts or replaces an existing document into Couchbase Server as an asynchronous operation.

Namespace: Couchbase
Assembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 0.0.0.0 (0.0.0.0)
Syntax
public Task<IOperationResult<T>> UpsertAsync<T>(
	string key,
	T value,
	ulong cas,
	uint expiration
)

Parameters

key
Type: System.String
The unique key for indexing.
value
Type: T
The value for the key.
cas
Type: System.UInt64
The CAS (Check and Set) value for optimistic concurrency.
expiration
Type: System.UInt32
The time-to-live (ttl) for the key in seconds.
Type Parameters
T
The Type of the value to be inserted.

Return Value

Type: Task<IOperationResult<T>>
The Task<TResult> object representing the asynchronous operation.

Implements

IBucket.UpsertAsync<T>(String, T, UInt64, UInt32)
Remarks
Expirations over 30 * 24 * 60 * 60 (the amount of seconds in 30 days) are interpreted as a UNIX timestamp of the date at which the document expires. see documentation section about expiration.
See Also