Class MutateInSpecBuilder
A builder for generating an array of mutation Sub-Document operations.
Namespace: Couchbase.KeyValue
Assembly: Couchbase.NetClient.dll
Syntax
public class MutateInSpecBuilder : object
Methods
| Improve this Doc View SourceArrayAddUnique<T>(String, T, Boolean, Boolean)
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 = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value to insert. |
Boolean | createPath | True to create the path if it doesn't exist. |
Boolean | 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, Boolean, Boolean)
Inserts an item to the end of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayAppend<T>(string path, T value, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value to insert. |
Boolean | createPath | True to create the path if it doesn't exist. |
Boolean | 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[], Boolean, Boolean)
Inserts multiple values to the end of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayAppend<T>(string path, T[] values, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
Boolean | createPath | True to create the path if it doesn't exist. |
Boolean | 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, Boolean, Boolean)
Inserts an item to an array element in a document given an index
Declaration
public MutateInSpecBuilder ArrayInsert<T>(string path, T value, bool createParents = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value to insert. |
Boolean | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
Boolean | 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[], Boolean, Boolean)
Inserts multiple values to an array element in a document given an index
Declaration
public MutateInSpecBuilder ArrayInsert<T>(string path, T[] values, bool createParents = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
Boolean | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
Boolean | 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, Boolean, Boolean)
Inserts an item to the beginning of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayPrepend<T>(string path, T value, bool createParents = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value to insert. |
Boolean | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
Boolean | 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[], Boolean, Boolean)
Inserts multiple values to the beginning of an array element in a document.
Declaration
public MutateInSpecBuilder ArrayPrepend<T>(string path, T[] values, bool createParents = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T[] | values | The values to insert. |
Boolean | createParents | Maps to 0x01 if true, otherwise omitted - create the path if it doesn't exist. |
Boolean | 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, Int64, Boolean, Boolean)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Decrement(string path, long delta, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the element. |
Int64 | delta | the amount to decrease the value by |
Boolean | createPath | |
Boolean | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Decrement(String, UInt64, Boolean, Boolean)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Decrement(string path, ulong delta, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the element. |
UInt64 | delta | the amount to decrease the value by |
Boolean | createPath | |
Boolean | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Increment(String, Int64, Boolean, Boolean)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Increment(string path, long delta, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the element. |
Int64 | delta | the amount to increase the value by |
Boolean | createPath | |
Boolean | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Increment(String, UInt64, Boolean, Boolean)
Performs an arithmetic increment or decrement on a numeric element within a document.
Declaration
public MutateInSpecBuilder Increment(string path, ulong delta, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the element. |
UInt64 | delta | the amount to increase the value by |
Boolean | createPath | |
Boolean | isXattr |
Returns
Type | Description |
---|---|
MutateInSpecBuilder |
Insert<T>(String, T, Boolean, Boolean)
Inserts an element into a document, failing if it exists.
Declaration
public MutateInSpecBuilder Insert<T>(string path, T value, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value of type "T". |
Boolean | createPath | True to create the path if it doesn't exist. |
Boolean | 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, Boolean)
Removes an element in a document.
Declaration
public MutateInSpecBuilder Remove(string path, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
Boolean | isXattr | true if the path is an xAttr; otherwise false. |
Returns
Type | Description |
---|---|
MutateInSpecBuilder | A MutateInSpecBuilder for chaining. |
Replace<T>(String, T, Boolean)
Replaces an element in a document, failing if it does not exist.
Declaration
public MutateInSpecBuilder Replace<T>(string path, T value, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value of type "T". |
Boolean | 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, Boolean, Boolean)
Inserts an element into a document, overriding the value if it exists
Declaration
public MutateInSpecBuilder Upsert<T>(string path, T value, bool createPath = null, bool isXattr = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to the JSON attribute. |
T | value | The value of type "T". |
Boolean | createPath | True to create the path if it doesn't exist. |
Boolean | 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. |