Couchbase .NET SDK | 3.7.2
Search Results for

    Show / Hide Table of Contents

    Interface IMutateInBuilder<TDocument>

    Exposes the creation of a set of mutation operations to be performed.

    Inherited Members
    ISubDocBuilder<TDocument>.Execute()
    ISubDocBuilder<TDocument>.ExecuteAsync()
    ISubDocBuilder<TDocument>.Key
    ISubDocBuilder<TDocument>.Count
    ISubDocBuilder<TDocument>.Timeout
    ITypeSerializerProvider.Serializer
    Namespace: Couchbase.Core.IO.Operations.SubDocument
    Assembly: Couchbase.NetClient.dll
    Syntax
    [Obsolete("This interface is not required and will be removed in a future release.")]
    public interface IMutateInBuilder<TDocument> : ISubDocBuilder<TDocument>, ITypeSerializerProvider
    Type Parameters
    Name Description
    TDocument

    The strong typed document (POCO) reflecting the structure of the paths.

    Properties

    | Edit this page View Source

    Cas

    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
    ulong
    | Edit this page View Source

    Expiry

    The "time-to-live" or "TTL" that specifies the document's lifetime.

    Declaration
    TimeSpan Expiry { get; }
    Property Value
    Type Description
    TimeSpan
    | Edit this page View Source

    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
    | Edit this page View Source

    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

    | Edit this page View Source

    ArrayAddUnique(object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    ArrayAddUnique(string, object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayAppend(bool, params 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
    bool createParents

    If true, the parent will be added to the document. The default is false.

    object[] values

    One or more values.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayAppend(object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayAppend(string, SubdocPathFlags, SubdocDocFlags, params 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.

    | Edit this page View Source

    ArrayAppend(string, bool, params 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.

    bool createParents

    If true, the parent will be added to the document. The default is false.

    object[] values

    One or more values.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    ArrayAppend(string, object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayInsert(string, SubdocPathFlags, SubdocDocFlags, params 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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    ArrayInsert(string, params 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.

    | Edit this page View Source

    ArrayPrepend(bool, params 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
    bool createParents

    If true, the parent will be added to the document. The default is false.

    object[] values

    One or more values.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayPrepend(object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    ArrayPrepend(string, SubdocPathFlags, SubdocDocFlags, params 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.

    | Edit this page View Source

    ArrayPrepend(string, bool, params 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.

    bool createParents

    If true, the parent will be added to the document. The default is false.

    object[] values

    One or more values.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    ArrayPrepend(string, object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    Counter(string, long, 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 = SubdocDocFlags.None)
    Parameters
    Type Name Description
    string path

    A string (N1QL syntax) used to specify a location within the document.

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

    | Edit this page View Source

    Counter(string, long, bool)

    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.

    long delta

    The value to increment or decrement the original value by.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    Insert(string, object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    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 = SubdocDocFlags.None)
    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.

    | Edit this page View Source

    Upsert(string, object, bool)

    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.

    bool createParents

    If true, the parent will be added to the document. The default is true.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    WithCas(long)

    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
    long cas

    The CAS value.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    WithCas(ulong)

    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
    ulong cas

    The CAS value.

    Returns
    Type Description
    IMutateInBuilder<TDocument>

    An IMutateInBuilder<TDocument> reference for chaining operations.

    | Edit this page View Source

    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>
    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    • Edit this page
    • View Source
    In this article
    Back to top © 2025 Couchbase, Inc.