# Improving Cypher code without using data type List

**URL:** <https://community.neo4j.com/t/improving-cypher-code-without-using-data-type-list/25734>\
**Category:** Neo4j Graph Platform\
**Tags:** cypher\
**Created:** [September 21, 2020, 4:56pm UTC](https://community.neo4j.com/t/improving-cypher-code-without-using-data-type-list/25734 "2020-09-21T16:56:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkretsch](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mkretsch/32/5860_2.png) [@mkretsch](https://community.neo4j.com/u/mkretsch)\
**Post date:** [September 21, 2020, 4:56pm UTC](https://community.neo4j.com/t/improving-cypher-code-without-using-data-type-list/25734/1 "2020-09-21T16:56:37Z")

</div>

I have a quite simple network model focused on individuals and companies and their connected identifiers. To ease viewing for analysts, I take the relationship  
(:Person) - [PHONE] -\> (:Phone)  
And create a phoneNumber property on the Person node using the name property of the Phone node. I created a list such that it supports more than one PHONE relationship and stakes the numbers as a list. However, I use Linkurious as our visualization software and it does not technically support lists as a data type. The solution still works, but any suggestions on how to complete the same task, but not as a list? Below is example of what I run in Neo4j to make these automated phoneNumber properties on Person nodes.

MATCH (n)-[:PHONE]-\>(p:Phone) WITH n, COLLECT (p.name) as phone\_list SET n.phoneNumber = phone\_list

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![gabriel\_toma](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gabriel_toma/32/722_2.png) [@gabriel\_toma](https://community.neo4j.com/u/gabriel_toma)\
**Post date:** [September 28, 2020, 4:25pm UTC](https://community.neo4j.com/t/improving-cypher-code-without-using-data-type-list/25734/2 "2020-09-28T16:25:48Z")

</div>

Have you tried reduce ([List functions - Cypher Manual](https://neo4j.com/docs/cypher-manual/current/functions/list/#functions-reduce)): reduce(init = "", n IN phone\_list| init + ","+ n.name+",") as phoneList (you've have to remove the trailling ',')
