IBucket.Upsert<T> Method (IDocument<T>, ReplicateTo, PersistTo)Couchbase .NET SDK 2.0
Inserts or replaces an existing JSON document into IBucket on a Couchbase Server.

Namespace: Couchbase.Core
Assembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
IDocumentResult<T> Upsert<T>(
	IDocument<T> document,
	ReplicateTo replicateTo,
	PersistTo persistTo
)

Parameters

document
Type: Couchbase.IDocument<T>
The IDocument<T> JSON document to add to the database.
replicateTo
Type: Couchbase.ReplicateTo
persistTo
Type: Couchbase.PersistTo
Type Parameters
T
The Type T value of the document to be updated or inserted.

Return Value

Type: IDocumentResult<T>
An object implementing IDocumentResult<T> with information regarding the operation.
See Also