cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Update a specific property list element

Hi,

I have a relationship property that is a list. Let's call the property r.list. The list is populated with several values. Now I want to modify the existing list to either delete or modify a specific element on the list.

The question is how do I perform the update in cypher? It doesn't appear that array indexing works (i.e. SET r.list[ index ] = "foo")

It looks like I could use reduce() but is that the only method available? Any insight would be greatly appreciated.

Bill

2 REPLIES 2

Cypher doesn't have much for list manipulation. Instead, install APOC Procedures, and take a look at the collection functions you can use here with CALL apoc.help('coll.')

Hi Andrew,

Thanks for pointing me to the apoc.coll functions. There is apoc.coll.set() and apoc.coll.remove() that use index as a parameter. That does the trick.

Bill