CouchbaseBucket Insert T  Method (String, T, ReplicateTo, PersistTo)Couchbase .NET SDK 2.0
Inserts a document into the database using a given key, failing if the key exists.

Namespace: Couchbase
Assembly: Couchbase.NetClient (in Couchbase.NetClient.dll) Version: 2.0.2.0 (2.0.2.0)
Syntax
public IOperationResult<T> Insert<T>(
	string key,
	T value,
	ReplicateTo replicateTo,
	PersistTo persistTo
)

Parameters

key
Type: System String
The unique key for indexing.
value
Type: T
The value 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 Insert T (String, T, ReplicateTo, PersistTo)
See Also