# How to RETURN node.\* instead of RETURN node.prop1

**URL:** <https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878>\
**Category:** Cypher\
**Tags:** cypher\
**Created:** [December 23, 2020, 6:42pm UTC](https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878 "2020-12-23T18:42:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clem](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/clem/32/4364_2.png) [@clem](https://community.neo4j.com/u/clem)\
**Post date:** [December 23, 2020, 6:42pm UTC](https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878/1 "2020-12-23T18:42:06Z")

</div>

If I want a traditional table of properties from a node, I know I can do:

`RETURN n.prop1, n.prop2, n.prop,` etc.

What I'd like to do is something like:  
`RETURN n.*` to return all the property values (as a short hand).

I don't want `RETURN n` as it returns a Map, which is harder to for me to skim visually for patterns.

I've google what I want, and there are some close matches, but I haven't been able to find exactly what I want. I've also tried various permutations of `UNWIND`, `keys()` etc.

I realize this could be a mess if the nodes have radically dissimilar property names.... but my data is very regular. I'd be happy to use the `keys()` function on one node as the set of properties for all my nodes that I'm matching.

---

<div class="post-metadata">

**Author:** ![jhakiz](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jhakiz/32/15601_2.png) [@jhakiz](https://community.neo4j.com/u/jhakiz)\
**Post date:** [December 23, 2020, 7:20pm UTC](https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878/2 "2020-12-23T19:20:20Z")

</div>

@clem, if you need to retrieve only the properties of a node; something like `RETURN n.*`, you can try with `RETURN properties(n)` and see if it will meet your need.

it will return the keys of the node associated with their values.

---

<div class="post-metadata">

**Author:** ![clem](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/clem/32/4364_2.png) [@clem](https://community.neo4j.com/u/clem)\
**Post date:** [December 23, 2020, 8:12pm UTC](https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878/3 "2020-12-23T20:12:07Z")

</div>

Nope. That's not what I want.

If I do:  
`match(p:Person {name:"Ed Harris"}) return properties(p)`

I get:

```auto
╒════════════════════════════════╕
│"properties(p)" │
╞════════════════════════════════╡
│{"born":1950,"name":"Ed Harris"}│
└────────────────────────────────┘

```

I want the equivalent of:

`match(p:Person {name:"Ed Harris"}) return p.name, p.born`

```auto
╒═══════════╤════════╕
│"p.name" │"p.born"│
╞═══════════╪════════╡
│"Ed Harris"│1950 │
└───────────┴────────┘

```

but not having to manually enter all the property names.

---

<div class="post-metadata">

**Author:** ![dominicvivek06](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dominicvivek06/32/5034_2.png) [@dominicvivek06](https://community.neo4j.com/u/dominicvivek06)\
**Post date:** [December 24, 2020, 2:52pm UTC](https://community.neo4j.com/t/how-to-return-node-instead-of-return-node-prop1/30878/4 "2020-12-24T14:52:54Z")

</div>

Hi @clem,

There is no PIVOT functionality in neo4j. As an alternate solution I have created a python function, that can take any node name (or all if NONE provided).

Python jupyter notebook file -\> [neo4j\_pivot.ipynb](https://github.com/dominicvivek06/neo4j/blob/master/community/pivot_neo4j/neo4j_pivot.ipynb)

Github URL -\> [https://github.com/dominicvivek06/neo4j/tree/master/community/pivot\_neo4j](https://github.com/dominicvivek06/neo4j/tree/master/community/pivot_neo4j)

_Note - Try Exception not implemented in python as of now_

The Cypher query to get key, value pair for the node is

```auto
MATCH (n) 
UNWIND keys(n) as property 
RETURN labels(n) as node,id(n) as node_id , property, n[property] as value;

```

Blog Post -\> [URL](http://www.dominickumar.com/blog/neo4j-pivot-functionality/)

Let me know how I can assist further.
