In this case I can changing only one object OBJECT_PUT(d.data,"en",OBJECT_PUT(d.data.en,"booksSelect"bs))
But I need change many
OBJECT_PUT(d.data,"en",OBJECT_PUT(d.data.en,"booksSelect", bs.en)) ,
OBJECT_PUT(d.data,"en",OBJECT_PUT(d.data.ru,"booksSelectRU", bs.ru))
OBJECT_PUT(d.data,"en",OBJECT_PUT(d.data.ым,"booksSelectSV", bs.sv))
AND i want to get the resulting document with these changes
I want to iterate over all key-objects inside rootField and when commonField="value1", I want to instead have with commonField="value1.1". Is this possible for Couchbase Server 6.5?
Note: I have no previous knowledge of what fields a, b, c can be, and have to write my query accordingly
I wrote an UPDATE query I thought would work, but gives an error
UPDATE <<bucket_name>>
USE KEYS <<keys>>
SET rootField.[fieldKey].commonField = "value1.1" FOR fieldKey IN (
ARRAY elem.name FOR elem IN OBJECT_INNER_PAIRS(rootField) WHEN elem.val.commonField = "value1" END
);