Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Class MutateInSpecBuilder

A builder for generating an array of mutation Sub-Document operations.

Inheritance
object
MutateInSpecBuilder
MutateInSpecBuilder<TDocument>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Couchbase.KeyValue
Assembly: Couchbase.NetClient.dll
Syntax
public class MutateInSpecBuilder

Constructors

View Source

MutateInSpecBuilder()

Declaration
public MutateInSpecBuilder()

Methods

View Source

ArrayAddUnique<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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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
View Source

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
View Source

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
View Source

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
View Source

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.

View Source

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.

View Source

ReplaceBodyWithXattr(string)

Declaration
public MutateInSpecBuilder ReplaceBodyWithXattr(string path)
Parameters
Type Name Description
string path
Returns
Type Description
MutateInSpecBuilder
View Source

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.

View Source

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
View Source

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.

  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.