Interface IMutateInBuilder<TDocument>
Exposes the creation of a set of mutation operations to be performed.
Inherited Members
Namespace: Couchbase.Core.IO.Operations.SubDocument
Assembly: Couchbase.NetClient.dll
Syntax
public interface IMutateInBuilder<TDocument> : ISubDocBuilder<TDocument>, ITypeSerializerProvider
Type Parameters
Name | Description |
---|---|
TDocument | The strong typed document (POCO) reflecting the structure of the paths. |
Properties
| Improve this Doc View SourceCas
A "check-and-set" value for ensuring that a document has not been modified by another thread.
Declaration
ulong Cas { get; }
Property Value
Type | Description |
---|---|
UInt64 |
Expiry
The "time-to-live" or "TTL" that specifies the document's lifetime.
Declaration
TimeSpan Expiry { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
PersistTo
A durability constraint ensuring that a document has been persisted to the n^th node.
Declaration
PersistTo PersistTo { get; }
Property Value
Type | Description |
---|---|
PersistTo |
ReplicateTo
A durability constraint for ensuring that the document has been replicated to the n^th node.
Declaration
ReplicateTo ReplicateTo { get; }
Property Value
Type | Description |
---|---|
ReplicateTo |
Methods
| Improve this Doc View SourceArrayAddUnique(Object, Boolean)
Adds a value to an array if the value does not already exist in the array at the root of the JSON document.
Declaration
IMutateInBuilder<TDocument> ArrayAddUnique(object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
Object | value | A unique value. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAddUnique(String, Object, SubdocPathFlags, SubdocDocFlags)
Adds a value to an array if the value does not already exist in the array.
Declaration
IMutateInBuilder<TDocument> ArrayAddUnique(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | A unique value. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAddUnique(String, Object, Boolean)
Adds a value to an array if the value does not already exist in the array.
Declaration
IMutateInBuilder<TDocument> ArrayAddUnique(string path, object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | A unique value. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(Boolean, Object[])
Inserts one or more values at the end of an array that is the root of a JSON document.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(bool createParents = false, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
Boolean | createParents | If |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(Object, Boolean)
Inserts an array value at the end of an array that is the root of a JSON document.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
Object | value | An array value. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(String, SubdocPathFlags, SubdocDocFlags, Object[])
Inserts one or more values to the end of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(string path, SubdocPathFlags pathFlags, SubdocDocFlags docFlags, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(String, Boolean, Object[])
Inserts one or more values to the end of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(string path, bool createParents = false, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Boolean | createParents | If |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(String, Object, SubdocPathFlags, SubdocDocFlags)
Inserts a value to the end of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An aray value. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayAppend(String, Object, Boolean)
Inserts a value to the end of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayAppend(string path, object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An aray value. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayInsert(String, SubdocPathFlags, SubdocDocFlags, Object[])
Inserts one or more values at a given position within an array. The position is indicated as part of the path.
Declaration
IMutateInBuilder<TDocument> ArrayInsert(string path, SubdocPathFlags pathFlags, SubdocDocFlags docFlags, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayInsert(String, Object)
Inserts a value at a given position within an array. The position is indicated as part of the path.
Declaration
IMutateInBuilder<TDocument> ArrayInsert(string path, object value)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | A value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayInsert(String, Object, SubdocPathFlags, SubdocDocFlags)
Inserts a value at a given position within an array. The position is indicated as part of the path.
Declaration
IMutateInBuilder<TDocument> ArrayInsert(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | A value. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayInsert(String, Object[])
Inserts one or more values at a given position within an array. The position is indicated as part of the path.
Declaration
IMutateInBuilder<TDocument> ArrayInsert(string path, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(Boolean, Object[])
Inserts one or more values to the beginning of an array that is the root of a JSON document.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(bool createParents = false, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
Boolean | createParents | If |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(Object, Boolean)
Inserts a value to the beginning of an array that is the root of a JSON document.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(String, SubdocPathFlags, SubdocDocFlags, Object[])
Inserts one or more values to the beginning of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(string path, SubdocPathFlags pathFlags, SubdocDocFlags docFlags, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(String, Boolean, Object[])
Inserts one or more values to the beginning of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(string path, bool createParents = false, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Boolean | createParents | If |
Object[] | values | One or more values. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(String, Object, SubdocPathFlags, SubdocDocFlags)
Inserts a value to the beginning of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
ArrayPrepend(String, Object, Boolean)
Inserts a value to the beginning of an array in a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> ArrayPrepend(string path, object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Counter(String, Int64, SubdocPathFlags, SubdocDocFlags)
Performs an arithmetic increment or decrement operation on a numeric value in a document.
Declaration
IMutateInBuilder<TDocument> Counter(string path, long delta, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Int64 | delta | The value to increment or decrement the original value by. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Counter(String, Int64, Boolean)
Performs an arithmetic increment or decrement operation on a numeric value in a document.
Declaration
IMutateInBuilder<TDocument> Counter(string path, long delta, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Int64 | delta | The value to increment or decrement the original value by. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Insert(String, Object, SubdocPathFlags, SubdocDocFlags)
Inserts an element into a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Insert(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
SubdocPathFlags | pathFlags | The lookup flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Insert(String, Object, Boolean)
Inserts an element into a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Insert(string path, object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Remove(String)
Removes an element or value from a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Remove(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Remove(String, SubdocPathFlags, SubdocDocFlags)
Removes an element or value from a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Remove(string path, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Replace(String, Object)
Replaces an element or value within a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Replace(string path, object value)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Replace(String, Object, SubdocPathFlags, SubdocDocFlags)
Replaces an element or value within a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Replace(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Upsert(String, Object, SubdocPathFlags, SubdocDocFlags)
Inserts or updates an element within or into a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Upsert(string path, object value, SubdocPathFlags pathFlags, SubdocDocFlags docFlags = default(SubdocDocFlags))
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
SubdocPathFlags | pathFlags | The path flags. |
SubdocDocFlags | docFlags | The document flags. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
Upsert(String, Object, Boolean)
Inserts or updates an element within or into a JSON document at a given path.
Declaration
IMutateInBuilder<TDocument> Upsert(string path, object value, bool createParents = true)
Parameters
Type | Name | Description |
---|---|---|
String | path | A string (N1QL syntax) used to specify a location within the document. |
Object | value | An array value, dictionary entry, scalar or any other valid JSON item. |
Boolean | createParents | If |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithCas(Int64)
A "check-and-set" value for ensuring that a document has not been modified by another thread.
Declaration
IMutateInBuilder<TDocument> WithCas(long cas)
Parameters
Type | Name | Description |
---|---|---|
Int64 | cas | The CAS value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithCas(UInt64)
A "check-and-set" value for ensuring that a document has not been modified by another thread.
Declaration
IMutateInBuilder<TDocument> WithCas(ulong cas)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | cas | The CAS value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithDurability(PersistTo)
A durability constraint ensuring that a document has been persisted to the n^th node.
Declaration
IMutateInBuilder<TDocument> WithDurability(PersistTo persistTo)
Parameters
Type | Name | Description |
---|---|---|
PersistTo | persistTo | The PersistTo value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> |
WithDurability(PersistTo, ReplicateTo)
Sets the ReplicateTo and PersistTo values for a document.
Declaration
IMutateInBuilder<TDocument> WithDurability(PersistTo persistTo, ReplicateTo replicateTo)
Parameters
Type | Name | Description |
---|---|---|
PersistTo | persistTo | The PersistTo value. |
ReplicateTo | replicateTo | The ReplicateTo value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithDurability(ReplicateTo)
A durability constraint ensuring that a document has been persisted to the n^th node.
Declaration
IMutateInBuilder<TDocument> WithDurability(ReplicateTo replicateTo)
Parameters
Type | Name | Description |
---|---|---|
ReplicateTo | replicateTo | The ReplicateTo value. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithExpiry(TimeSpan)
Applies an expiration to a document.
Declaration
IMutateInBuilder<TDocument> WithExpiry(TimeSpan expiry)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | expiry | The "time-to-live" or TTL of the document. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |
WithTimeout(TimeSpan)
The maximum time allowed for an operation to live before timing out.
Declaration
IMutateInBuilder<TDocument> WithTimeout(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | The timeout. |
Returns
Type | Description |
---|---|
IMutateInBuilder<TDocument> | An IMutateInBuilder<TDocument> reference for chaining operations. |