Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Class MutateInSpecBuilderExtensions

Extensions for MutateInSpecBuilder<TDocument>.

Inheritance
object
MutateInSpecBuilderExtensions
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 static class MutateInSpecBuilderExtensions

Methods

View Source

ArrayAddUnique<TDocument, TContent, TElement>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TElement, bool)

Add a unique fragment of type TContent into an array in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> ArrayAddUnique<TDocument, TContent, TElement>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TElement value, bool createPath = false) where TContent : ICollection<TElement>
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the array from the parent document.

TElement value

Value to insert into the array.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the array within the parent document.

TElement

Type of the array element being added.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

ArrayAppend<TDocument, TContent, TElement>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TElement, bool)

Push a fragment of type TContent into the back of an array in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> ArrayAppend<TDocument, TContent, TElement>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TElement value, bool createPath = false) where TContent : ICollection<TElement>
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the array from the parent document.

TElement value

Value to push into the array.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the array within the parent document.

TElement

Type of the array element being pushed.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

ArrayInsert<TDocument, TElement>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TElement>>, TElement)

Insert a fragment of type TElement into an array in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> ArrayInsert<TDocument, TElement>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TElement>> path, TElement value)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TElement>> path

Lambda expression path that navigates to the array element from the parent document.

TElement value

Value to insert into the array.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TElement

Type of the array element being inserted.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

ArrayPrepend<TDocument, TContent, TElement>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TElement, bool)

Push a fragment of type TContent into the front of an array in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> ArrayPrepend<TDocument, TContent, TElement>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TElement value, bool createPath = false) where TContent : ICollection<TElement>
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the array from the parent document.

TElement value

Value to push into the array.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the array within the parent document.

TElement

Type of the array element being pushed.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Decrement<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, long, bool)

Decrement a counter of type TContent in a document of type TDocument, using a given lambda expression path.

Declaration
[Obsolete("Use the Decrement overload which accepts an unsigned long. Negative signed long deltas may produce unexpected results.")]
public static MutateInSpecBuilder<TDocument> Decrement<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, long delta, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the counter from the parent document.

long delta

Amount to decrement the counter.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Decrement<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, ulong, bool)

Decrement a counter of type TContent in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Decrement<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, ulong delta, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the counter from the parent document.

ulong delta

Amount to decrement the counter.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Increment<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, long, bool)

Increment a counter of type TContent in a document of type TDocument, using a given lambda expression path.

Declaration
[Obsolete("Use the Increment overload which accepts an unsigned long.")]
public static MutateInSpecBuilder<TDocument> Increment<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, long delta, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the counter from the parent document.

long delta

Amount to increment the counter.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Increment<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, ulong, bool)

Increment a counter of type TContent in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Increment<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, ulong delta, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the counter from the parent document.

ulong delta

Amount to increment the counter.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Insert<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TContent, bool)

Insert a fragment of type TContent into a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Insert<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TContent value, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the subdocument from the parent document.

TContent value

Value to insert at path.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Remove<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>)

Remove a fragment of type TContent from a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Remove<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the subdocument from the parent document.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Replace<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TContent)

Replace a fragment of type TContent in a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Replace<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TContent value)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the subdocument from the parent document.

TContent value

Value to replace at path.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

View Source

Upsert<TDocument, TContent>(MutateInSpecBuilder<TDocument>, Expression<Func<TDocument, TContent>>, TContent, bool)

Update or insert a fragment of type TContent into a document of type TDocument, using a given lambda expression path.

Declaration
public static MutateInSpecBuilder<TDocument> Upsert<TDocument, TContent>(this MutateInSpecBuilder<TDocument> builder, Expression<Func<TDocument, TContent>> path, TContent value, bool createPath = false)
Parameters
Type Name Description
MutateInSpecBuilder<TDocument> builder

MutateInSpecBuilder<TDocument> where the the subdocument mutation is being built.

Expression<Func<TDocument, TContent>> path

Lambda expression path that navigates to the subdocument from the parent document.

TContent value

Value to update or insert at path.

bool createPath

If true, create parents along the path if they don't exist.

Returns
Type Description
MutateInSpecBuilder<TDocument>

The builder for expression chaining.

Type Parameters
Name Description
TDocument

Type of the parent document.

TContent

Type of the subdocument.

Exceptions
Type Condition
ArgumentNullException

builder or path is null.

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