The UPDATE
operation modifies the content of existing documents in a collection.
UPDATE
statement, you can update specific fields within the documents based on specified conditions:
your_collection_name
is the name of the collection in which you want to update data.field1 = value1, field2.subfield = value2, ...
represents the fields to be updated and their corresponding new value[condition]
is the expression or set of conditions that determine which documents should be included in the result set.MAP
, specify the field-value pairs you want to update.
For MAP
syntax, see Ditto Query Language > Types and Definitions > Map Operations.
UNSET
is available in 4.11 and later.MAP
, all children data types are iteratively unset.UNSET
on a large number of dynamically generated fields (for
example, dynamically created keys in a CRDT map) may cause performance to
degrade due to metadata accumulation over time. Benchmarks for this will
vary depending on your dataset size and query cardinality. You can
mitigate this accumulation by calling UNSET
on a parent field
(or deleting the document itself).