Update query for matching nested records

Here is my document stored in couchbase

[
    {
        "items" : {
            "A": {
                "items" : {
                    "abcd" : {
                        "id" : 1234,
                        "name": "AAA"
                    },
                    "defg" : {
                        "id" : 1234,
                        "name" : "BBB"
                    },
                    "hijk" : {
                         "id" : 5678,
                        "name" : "CCC"
                    }
                }
            }
        }
    }
]

I want to update the name to ‘XXX’ for the nested objects which has the id’s 1234 . Please note that the keys “abcd”, “efgh” and “hijk” are dynamic. Thanks in advance for the help

It updates any where in the document that has { “id” : 1234 }.
If you want only on specific path change to WITHIN d.items.A.ietms

UPDATE mybucket AS d
SET v.name = "XXX" FOR  v WITHIN d WHEN v.id = 1234 END
WHERE .............;