Adding values to an array when upserting

Hello!
I am extremely new to couchbase and I am trying to understand if it is possible to upsert a document and adding values to an array if it exists.
In mongo, the command is $push [here] ($push — MongoDB Manual) are the docs on the operation.
I’ll share an example. Given this dataset:

{
    'key': 'test1',
    'test': ['test1', 'test2']
}

I want to add this dataset:

{
    'key': 'test1',
    'test': ['test3', 'test4']
}
{
    'key': 'test2',
    'test': ['test1', 'test2']
}

So that the final result will look like this:

{
    'key': 'test1',
    'test': ['test1', 'test2', 'test3', 'test4']
}
{
    'key': 'test2',
    'test': ['test1', 'test2']
}

Use ANSI Merge statement
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/merge.html

create index ix100 on default(`key`);
INSERT INTO default VALUES ("test1",{ 'key': 'test1', 'test': ['test1', 'test2'] });
MERGE INTO default AS m USING ([{ 'key': 'test1', 'test': ['test1', 'test2', 'test3', 'test4'] }, { 'key': 'test2', 'test': ['test1', 'test2'] }]) AS s ON m.`key` = s.`key`
WHEN MATCHED THEN UPDATE SET m.test = ARRAY_DISTINCT(ARRAY_CONCAT(m.test,s.test)) WHERE ANY v IN s.test SATISFIES v NOT IN m.test END
WHEN NOT MATCHED THEN INSERT (KEY s.`key`, VALUE s);