Update an attribute inside a array in a json docuemnt

@nacion.emelson

If condition is different or SET/UNSET that only option (Each SET/UNSET different FOR syntax).
In your case it same you can do this also

UPDATE default  AS module
USE KEYS "MODULE_1"
SET  module.fields[pos] = OBJECT_CONCAT (o, {"title":"Sample Added Field 3 Edited", "field":"addedField_3_edited"})
FOR pos:o IN module.fields
WHEN o.row = 3 AND o.section = 2 END;

Also you can use cascade OBJECT_PUT(), OBJECT_ADD(),… instead of OBJECT_CONCAT() Object Functions | Couchbase Docs

1 Like