Replaces a document for a given key if it exists, otherwise fails as an asynchronous operation.
Namespace: CouchbaseAssembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 0.0.0.0 (0.0.0.0)
Syntaxpublic Task<IOperationResult<T>> ReplaceAsync<T>(
string key,
T value,
uint expiration
)
public Task<IOperationResult<T>> ReplaceAsync<T>(
string key,
T value,
uint expiration
)
Public Function ReplaceAsync(Of T) (
key As String,
value As T,
expiration As UInteger
) As Task(Of IOperationResult(Of T))
Public Function ReplaceAsync(Of T) (
key As String,
value As T,
expiration As UInteger
) As Task(Of IOperationResult(Of T))
public:
generic<typename T>
virtual Task<IOperationResult<T>^>^ ReplaceAsync(
String^ key,
T value,
unsigned int expiration
) sealed
public:
generic<typename T>
virtual Task<IOperationResult<T>^>^ ReplaceAsync(
String^ key,
T value,
unsigned int expiration
) sealed
abstract ReplaceAsync :
key : string *
value : 'T *
expiration : uint32 -> Task<IOperationResult<'T>>
override ReplaceAsync :
key : string *
value : 'T *
expiration : uint32 -> Task<IOperationResult<'T>>
abstract ReplaceAsync :
key : string *
value : 'T *
expiration : uint32 -> Task<IOperationResult<'T>>
override ReplaceAsync :
key : string *
value : 'T *
expiration : uint32 -> Task<IOperationResult<'T>>
Parameters
- key
- Type: System.String
The unique key for indexing.
- value
- Type: T
The value for the key.
- 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.ReplaceAsync<T>(String, T, 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