Hi,
This is the test data.
CREATE (:SomeLabel {graph_information: ['prova', 'password']}),
(:SomeLabel {graph_information: ['prova', 'prova']}),
(:SomeLabel {graph_information: ['user1', 'prova']})
You can use ONE SET sentence like this.
But in your Where clause, I think the result is wrong.
MATCH (n)
WHERE
any(gi IN n.graph_information WHERE gi = 'prova')
SET n.graph_information = ['prova2', n.graph_information[1] ]
RETURN n.graph_information
n.graph_information
["prova2", "password"] <- OK
["prova2", "prova"] <- OK
["prova2", "prova"] <- The ID 'user1' has been changed.
I think 'prova' is an id, not a password, so it's better to specify it when searching.
MATCH (n)
WHERE n.graph_information[0] = 'prova'
SET n.graph_information = ['prova2', n.graph_information[1] ]
RETURN n.graph_information
["prova2", "password"] <- OK
["prova2", "prova"] <- OK
OR
MATCH (n)
WHERE n.graph_information = ['prova', 'password']
SET n.graph_information = ['prova2', n.graph_information[1] ]
RETURN n.graph_information
["prova2", "password"] <- OK
If you have a large number of records, you need an Index, so I think it's better to set the id and password as separate items from the array.