Question about using "array update"

Hi There
The following function updates “character” one by one
How can I get “update” as a “character_list” and update it all at once?

static update(user_uuid: string, character: Character): Promise<any> {
    return new Promise<any>((resolve: () => void, reject: (error_code: error.ERROR_CODE) => void) => {
        const query: string = util.format("update `game` use keys '%s_HOME' set character_list[idx]= %s for idx : c in character_list when c.uuid = '%s' end",
            user_uuid, JSON.stringify(character), character.uuid);
        couch_helper.query("game", query)
            .then((rows: Array<any>) => {
            .catch((error_code: error.ERROR_CODE) => {
                return reject(error_code);

Check this N1ql array update query?

insert into test (KEY, VALUE) VALUES (‘test’ , {“test_list”: [{“id”: “abc1”, “val”: 1}, {“id”: “abc2”, “val”: 2}, {“id”: “abc3”, “val”: 3}]})

“id”: “abc1”,
“val”: 10
“id”: “abc2”,
“val”: 11

one query -> two object update

If you need to update multiple values based on condition you can construct new array as follows.

UPDATE default SET test_list = ARRAY  CASE WHEN = "abc1" THEN {"id", "val":10}
                                           WHEN = "abc2" THEN {"id", "val":12}
                                           ELSE v END FOR v IN test_list END;