IBucket UpsertAsync T  Method (String, T, TimeSpan, ReplicateTo, PersistTo)Couchbase .NET SDK 2.1.0 Documentation
Inserts or replaces an existing document into Couchbase Server as an asynchronous operation.

Namespace: Couchbase.Core
Assembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 2.1.0.0 (2.1.0.0)
Syntax
Task<IOperationResult<T>> UpsertAsync<T>(
	string key,
	T value,
	TimeSpan expiration,
	ReplicateTo replicateTo,
	PersistTo persistTo
)

Parameters

key
Type: System String
The unique key for indexing.
value
Type: T
The value for the key.
expiration
Type: System TimeSpan
The time-to-live (ttl) for the key.
replicateTo
Type: Couchbase ReplicateTo
The durability requirement for replication.
persistTo
Type: Couchbase PersistTo
The durability requirement for persistence.
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.
See Also