Inserts or replaces an existing document into Couchbase Server.
Namespace: CouchbaseAssembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 2.0.0.0 (2.0.0.0)
Syntaxpublic IOperationResult<T> Upsert<T>(
string key,
T value,
TimeSpan expiration,
ReplicateTo replicateTo,
PersistTo persistTo
)
public IOperationResult<T> Upsert<T>(
string key,
T value,
TimeSpan expiration,
ReplicateTo replicateTo,
PersistTo persistTo
)
Public Function Upsert(Of T) (
key As String,
value As T,
expiration As TimeSpan,
replicateTo As ReplicateTo,
persistTo As PersistTo
) As IOperationResult(Of T)
Public Function Upsert(Of T) (
key As String,
value As T,
expiration As TimeSpan,
replicateTo As ReplicateTo,
persistTo As PersistTo
) As IOperationResult(Of T)
public:
generic<typename T>
virtual IOperationResult<T>^ Upsert(
String^ key,
T value,
TimeSpan expiration,
ReplicateTo replicateTo,
PersistTo persistTo
) sealed
public:
generic<typename T>
virtual IOperationResult<T>^ Upsert(
String^ key,
T value,
TimeSpan expiration,
ReplicateTo replicateTo,
PersistTo persistTo
) sealed
abstract Upsert :
key : string *
value : 'T *
expiration : TimeSpan *
replicateTo : ReplicateTo *
persistTo : PersistTo -> IOperationResult<'T>
override Upsert :
key : string *
value : 'T *
expiration : TimeSpan *
replicateTo : ReplicateTo *
persistTo : PersistTo -> IOperationResult<'T>
abstract Upsert :
key : string *
value : 'T *
expiration : TimeSpan *
replicateTo : ReplicateTo *
persistTo : PersistTo -> IOperationResult<'T>
override Upsert :
key : string *
value : 'T *
expiration : TimeSpan *
replicateTo : ReplicateTo *
persistTo : PersistTo -> IOperationResult<'T>
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:
IOperationResult<T>
An object implementing the
IOperationResult<T>interface.
Implements
IBucket.Upsert<T>(String, T, TimeSpan, ReplicateTo, PersistTo)
See Also