# Is it possible to Index a List property in Neo4j?

**URL:** https://community.neo4j.com/t/is-it-possible-to-index-a-list-property-in-neo4j/7780
**Category:** Neo4j Graph Platform
**Tags:** cypher, index
**Created:** [May 31, 2019, 10:32pm UTC](https://community.neo4j.com/t/is-it-possible-to-index-a-list-property-in-neo4j/7780 "2019-05-31T22:32:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![benjamin.squire](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/benjamin.squire/32/1496_2.png) [@benjamin.squire](https://community.neo4j.com/u/benjamin.squire)
#### Post date: [May 31, 2019, 10:32pm UTC](https://community.neo4j.com/t/is-it-possible-to-index-a-list-property-in-neo4j/7780/1 "2019-05-31T22:32:43Z")

</div>

Is it possible to create an index on objects inside list properties of Neo4j?

Lets say I have a bunch of Nodes  
`unwind range(1,100) as num CREATE (n:Person {current_id:num,old_id:[]});`

`call apoc.coll.zipToRows(range(1,100),range(200,300)) yield value with value[0] as old_id,value[1] as new_id Match (p:Person) where p.current_id = old_id SET p.old_id = p.old_id + old_id, p.current_id = new_id;`

`call apoc.coll.zipToRows(range(200,300),range(400,500)) yield value with value[0] as old_id,value[1] as new_id Match (p:Person) where p.current_id = old_id SET p.old_id = p.old_id + old_id, p.current_id = new_id;`

`call apoc.coll.zipToRows(range(400,500),range(600,700)) yield value with value[0] as old_id,value[1] as new_id Match (p:Person) where p.current_id = old_id SET p.old_id = p.old_id + old_id, p.current_id = new_id;`  
Is it possible to index the values inside old\_id such that if I want to find Person's with old\_id 5 the objects in old\_ids are indexed?

---

<div class="post-metadata">

### Author: ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)
#### Post date: [May 31, 2019, 11:03pm UTC](https://community.neo4j.com/t/is-it-possible-to-index-a-list-property-in-neo4j/7780/2 "2019-05-31T23:03:29Z")

</div>

This isn't supported at this time.

For lookup capability here we'd recommend modeling this as connected nodes instead, querying to them and traversing to the connected node.

Something like this for refactoring, though of course other considerations could alter your model (you can add your index on :OldId(id) before this, to improve the MERGE efficiency):

```auto
MATCH (p:Person)
UNWIND p.old_id as oldId
MERGE (old:OldId {id:oldId})
MERGE (p)-[:HAD_ID]->(old)

```
