Class MutateInSpecBuilder
A builder for generating an array of mutation Sub-Document operations.
Inherited Members
Namespace: Couchbase.KeyValue
Assembly: Couchbase.NetClient.dll
Syntax
public class MutateInSpecBuilder
Methods
| Edit this page View SourceArrayAddUnique<T>(string, T, bool, bool)
Adds a value into an array element if the value does not already exist.
Declaration
public MutateInSpecBuilder ArrayAddUnique<T>(string path, T value, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value to insert. |
bool | createPath | True to create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayAppend<T>(string, T, bool, bool)
Inserts an item to the end of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayAppend<T>(string path, T value, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value to insert. |
bool | createPath | True to create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayAppend<T>(string, T[], bool, bool)
Inserts multiple values to the end of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayAppend<T>(string path, T[] values, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
bool | createPath | True to create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayInsert<T>(string, T, bool, bool)
Inserts an item to an array element in a document given an index
Declaration
public MutateInSpecBuilder ArrayInsert<T>(string path, T value, bool createParents = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value to insert. |
bool | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayInsert<T>(string, T[], bool, bool)
Inserts multiple values to an array element in a document given an index
Declaration
public MutateInSpecBuilder ArrayInsert<T>(string path, T[] values, bool createParents = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
bool | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayPrepend<T>(string, T, bool, bool)
Inserts an item to the beginning of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayPrepend<T>(string path, T value, bool createParents = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value to insert. |
bool | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
ArrayPrepend<T>(string, T[], bool, bool)
Inserts multiple values to the beginning of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayPrepend<T>(string path, T[] values, bool createParents = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
bool | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
Decrement(string, long, bool, bool)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
[Obsolete("Use the Decrement overload which accepts an unsigned long. Negative signed long deltas may produce unexpected results.")]
public MutateInSpecBuilder Decrement(string path, long delta, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the element. |
long | delta | the amount to decrease the value by |
bool | createPath | |
bool | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Decrement(string, ulong, bool, bool)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Decrement(string path, ulong delta, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the element. |
ulong | delta | the amount to decrease the value by |
bool | createPath | |
bool | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Increment(string, long, bool, bool)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
[Obsolete("Use the Increment overload which accepts an unsigned long.")]
public MutateInSpecBuilder Increment(string path, long delta, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the element. |
long | delta | the amount to increase the value by |
bool | createPath | |
bool | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Increment(string, ulong, bool, bool)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Increment(string path, ulong delta, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the element. |
ulong | delta | the amount to increase the value by |
bool | createPath | |
bool | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Insert<T>(string, T, bool, bool)
Inserts an element into a document, failing if it exists.
Declaration
public MutateInSpecBuilder Insert<T>(string path, T value, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value of type "T". |
bool | createPath | True to create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
Remove(string, bool)
Removes an element in a document.
Declaration
public MutateInSpecBuilder Remove(string path, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Replace<T>(string, T, bool)
Replaces an element in a document, failing if it does not exist.
Declaration
public MutateInSpecBuilder Replace<T>(string path, T value, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value of type "T". |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |
SetDoc<T>(T)
Declaration
public MutateInSpecBuilder SetDoc<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Type Parameters
Name | Description |
---|---|
T |
Upsert<T>(string, T, bool, bool)
Inserts an element into a document, overriding the value if it exists
Declaration
public MutateInSpecBuilder Upsert<T>(string path, T value, bool createPath = false, bool isXattr = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the JSON attribute. |
T | value | The value of type "T". |
bool | createPath | True to create the path if it doesn't exist. |
bool | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
T | The type of the value being inserted. |