# List properties of a label/relationship

**URL:** https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718
**Category:** Modeling
**Created:** [January 8, 2021, 2:35pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718 "2021-01-08T14:35:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dario.piantanida](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dario.piantanida/32/15963_2.png) [@dario.piantanida](https://community.neo4j.com/u/dario.piantanida)
#### Post date: [January 8, 2021, 2:35pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718/1 "2021-01-08T14:35:28Z")

</div>

Hello, I need to list all the possibile properties of all the nodes of type "CI"; next I need to list of properties of relationship "USES". Can you please help?

I find examples, but the use some APOC.MAP functions that my Neo refuses to recognize.

Thank you

---

<div class="post-metadata">

### Author: ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)
#### Post date: [January 8, 2021, 3:05pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718/2 "2021-01-08T15:05:49Z")

</div>

Hello @dario.piantanida 🙂

**Without APOC**

- Nodes:

```auto
MATCH (n:CI)
WITH REDUCE(output = [], r IN collect(keys(n)) | output + r) AS flat
UNWIND flat AS item
RETURN COLLECT(DISTINCT item) AS keys

```

- Relations:

```auto
MATCH ()-[n:USES]->()
WITH REDUCE(output = [], r IN collect(keys(n)) | output + r) AS flat
UNWIND flat AS item
RETURN COLLECT(DISTINCT item) AS keys

```

**With APOC**

- Nodes:

```auto
MATCH (n:CI)
RETURN apoc.coll.toSet(apoc.coll.flatten(collect(keys(n)))) AS keys

```

- Relations:

```auto
MATCH ()-[n:USES]->()
RETURN apoc.coll.toSet(apoc.coll.flatten(collect(keys(n)))) AS keys

```

Don't forget to check in the neo4j.conf file these settings:

```auto
dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.whitelist=apoc.*

```

You can also have a look at the [properties()](https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-properties) function if you want to get the values instead of the keys.

Regards,  
Cobra

---

<div class="post-metadata">

### Author: ![dario.piantanida](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dario.piantanida/32/15963_2.png) [@dario.piantanida](https://community.neo4j.com/u/dario.piantanida)
#### Post date: [January 8, 2021, 3:21pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718/3 "2021-01-08T15:21:54Z")

</div>

Macinando, ho trovato questa che sembra soddisfacente, che dici?

call db.schema.nodeTypeProperties() yield nodeType, nodeLabels, propertyName, propertyTypes  
where "CI" in nodeLabels  
return nodeType, propertyName, propertyTypes

---

<div class="post-metadata">

### Author: ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)
#### Post date: [January 8, 2021, 3:28pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718/4 "2021-01-08T15:28:21Z")

</div>

It's a good option, I forgot this one 🙂  
Choose the one you prefer 🙂

---

<div class="post-metadata">

### Author: ![dario.piantanida](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dario.piantanida/32/15963_2.png) [@dario.piantanida](https://community.neo4j.com/u/dario.piantanida)
#### Post date: [January 8, 2021, 3:45pm UTC](https://community.neo4j.com/t/list-properties-of-a-label-relationship/31718/5 "2021-01-08T15:45:44Z")

</div>

Sorry, I wrote in Italian as I didn't remember I was on an English community! 🤣

Thanks for your support!
