# Return all nodes properties

**URL:** https://community.neo4j.com/t/return-all-nodes-properties/51627
**Category:** Cypher
**Created:** [February 8, 2022, 9:10am UTC](https://community.neo4j.com/t/return-all-nodes-properties/51627 "2022-02-08T09:10:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sfuertes](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sfuertes/32/21957_2.png) [@sfuertes](https://community.neo4j.com/u/sfuertes)
#### Post date: [February 8, 2022, 9:10am UTC](https://community.neo4j.com/t/return-all-nodes-properties/51627/1 "2022-02-08T09:10:12Z")

</div>

Hi,

I'm an early begginer in Neo4j and i need some help with the return syntax.

I want to return all nodes properties but i'm not able to get them without null values and repeated nodes.

This is how i create it.

CREATE (a: Formulario {Nombre:'PS2115'})  
CREATE (b: Datos\_Internos {Autor:'Sergio', Fecha:'07/02/2022', Identificador:'847', Revision:'3', Descripcion:'Una descripcion bonita'})  
CREATE (c: Datos\_Cliente {Nombre:'Igeteam', Direccion:'Parque Tecnologico'})  
CREATE (d: Persona\_Contacto {Nombre:'Gerente', Telefono:'654789321', Email:'Gerente@gamil.com', Cargo:'Gerente'})

CREATE (a)-[:Datos]-\>(b)  
CREATE (a)-[:Datos]-\>(c)  
CREATE (c)-[:Contacto]-\>(d)

And this is the resulting graph.

![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/e/3/e32a69496553f7a29a4a6087a85a4015b22d29a8.png)

Now i am trying to return the properties and values of the nodes.

MATCH (f:Formulario{Nombre:'PS2115'})-[:Datos]-\>(c)  
OPTIONAL MATCH(c)-[:Contacto]-\>(d)  
WITH f,c,d  
RETURN{Proyecto: properties(f), Datos: properties(c), Persona\_Contacto: properties(d)}

![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/0/8/08e081b2111fbc26131f4eec4286a64c1126fc59.png)

I want to know if it is possible to get only one message with all the information of the nodes properties.

Thanks!!

---

<div class="post-metadata">

### Author: ![giuseppe\_villan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/giuseppe_villan/32/11871_2.png) [@giuseppe\_villan](https://community.neo4j.com/u/giuseppe_villan)
#### Post date: [February 8, 2022, 9:49am UTC](https://community.neo4j.com/t/return-all-nodes-properties/51627/2 "2022-02-08T09:49:14Z")

</div>

@sfuertes

If possible, you could use the Apoc procedures, in particular this one [apoc.map.merge - APOC Extended Documentation](https://neo4j.com/labs/apoc/4.0/overview/apoc.map/apoc.map.merge/) (or maybe also the [apoc.map.mergeList - APOC Extended Documentation](https://neo4j.com/labs/apoc/4.0/overview/apoc.map/apoc.map.mergeList/) if you have a lot of maps)

```auto
MATCH (f:Formulario{Nombre:'PS2115'})-[:Datos]->(c)
OPTIONAL MATCH(c)-[:Contacto]->(d)
WITH f,c,d
RETURN apoc.map.merge( apoc.map.merge(properties(f), properties(c)), properties(d))

```

---

<div class="post-metadata">

### Author: ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)
#### Post date: [February 8, 2022, 2:03pm UTC](https://community.neo4j.com/t/return-all-nodes-properties/51627/3 "2022-02-08T14:03:33Z")

</div>

If you want them collected and don't care which Persona\_Contracto is associated with which Datos.

MATCH (f:Formulario{Nombre:'PS2115'})-[:Datos]-\>(c)  
OPTIONAL MATCH(c)-[:Contacto]-\>(d)  
WITH f, collect(properties(c)) as datos, collect(properties(d)) as persona\_contacto  
RETURN{Proyecto: properties(f), Datos: datos, Persona\_Contacto: persona\_contacto}

If you want to the persona\_contacto associated with its dates (query assumes zero or one d nodes per c node, and I didn't know what to call label XX):

MATCH (f:Formulario{Nombre:'PS2115'})-[:Datos]-\>(c)  
CALL {  
WITH c  
OPTIONAL MATCH(c)-[:Contacto]-\>(d)  
RETURN {datos: properties(c), persona\_contacto: properties(d)} as datos  
}  
RETURN{Proyecto: properties(f), XX: collect(datos)}
