couchbase
    Preparing search index...

    Class MutateInSpec

    Represents a sub-operation to perform within a mutate-in operation.

    Index

    Accessors

    Methods

    • Creates a MutateInSpec for adding unique values to an array in a document. This operation will only add values if they do not already exist elsewhere in the array.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to add.

      • Optionaloptions: { createPath?: boolean; multi?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalmulti?: boolean

          If set, this enables an array of values to be passed as value, and each element of the passed array is added to the array.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for adding a value to the end of an array in a document.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to add.

      • Optionaloptions: { createPath?: boolean; multi?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalmulti?: boolean

          If set, this enables an array of values to be passed as value, and each element of the passed array is added to the array.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for adding a value to a specified location in an array in a document. The path should specify a specific index in the array and the new values are inserted at this location.

      Parameters

      • path: string

        The path to an element of an array.

      • value: any

        The value to add.

      • Optionaloptions: { createPath?: boolean; multi?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalmulti?: boolean

          If set, this enables an array of values to be passed as value, and each element of the passed array is added to the array.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for adding a value to the beginning of an array in a document.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to add.

      • Optionaloptions: { createPath?: boolean; multi?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalmulti?: boolean

          If set, this enables an array of values to be passed as value, and each element of the passed array is added to the array.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for decrementing the value of a field in a document.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to subtract.

      • Optionaloptions: { createPath?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for incrementing the value of a field in a document.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to add.

      • Optionaloptions: { createPath?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for inserting a field into the document. Failing if the field already exists at the specified path.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to insert.

      • Optionaloptions: { createPath?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for remove a field from a document.

      Parameters

      • path: string

        The path to the field.

      • Optionaloptions: { xattr?: boolean }

        Optional parameters for this operation.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for replacing a field on a document. This updates the value of the specified field, failing if the field does not exits.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to write.

      • Optionaloptions: { xattr?: boolean }

        Optional parameters for this operation.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec

    • Creates a MutateInSpec for upserting a field on a document. This updates the value of the specified field, or creates the field if it does not exits.

      Parameters

      • path: string

        The path to the field.

      • value: any

        The value to write.

      • Optionaloptions: { createPath?: boolean; xattr?: boolean }

        Optional parameters for this operation.

        • OptionalcreatePath?: boolean

          Whether or not the path to the field should be created if it does not already exist.

        • Optionalxattr?: boolean

          Whether this operation should reference the document body or the extended attributes data for the document.

      Returns MutateInSpec