Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-02-2020 12:17 PM
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
10-02-2020 12:27 PM
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.')
10-02-2020 01:30 PM
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
All the sessions of the conference are now available online