Skip to main content

DocUpdateMutation

Type Alias DocUpdateMutation 

Source
pub type DocUpdateMutation = DocMutation;
Expand description

A single field-level mutation applied by Database::doc_update.

Aliased Type§

pub enum DocUpdateMutation {
    Set {
        path: String,
        value: Value,
    },
    Del {
        path: String,
    },
    Incr {
        path: String,
        delta: f64,
    },
    Push {
        path: String,
        value: Value,
    },
    Pull {
        path: String,
        value: Value,
    },
}

Variants§

§

Set

Set a field path to a JSON value, creating missing intermediate objects.

Fields

§path: String

Dotted field path (for example address.city).

§value: Value

New JSON value for the path.

§

Del

Delete one field path when present.

Fields

§path: String

Dotted field path (for example tags).

§

Incr

Increment an existing numeric field by delta.

Fields

§path: String

Dotted field path to increment.

§delta: f64

Increment amount.

§

Push

Append one JSON value to an array field, creating the array when missing.

Fields

§path: String

Dotted field path to an array.

§value: Value

Value to append.

§

Pull

Remove all array items that exactly match the supplied value.

Fields

§path: String

Dotted field path to an array.

§value: Value

Value to remove.