# Computed Property Names in Neo4j?

**URL:** https://community.neo4j.com/t/computed-property-names-in-neo4j/50421
**Category:** Cypher
**Tags:** cypher, operations
**Created:** [January 13, 2022, 10:44am UTC](https://community.neo4j.com/t/computed-property-names-in-neo4j/50421 "2022-01-13T10:44:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![klug](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/klug/32/6243_2.png) [@klug](https://community.neo4j.com/u/klug)
#### Post date: [January 13, 2022, 10:44am UTC](https://community.neo4j.com/t/computed-property-names-in-neo4j/50421/1 "2022-01-13T10:44:47Z")

</div>

Hello everyone,  
for a cypher statement that I am coding I would love to know whether there is a cypher functionality like in javascript's [key] : value.  
I am querying an object which is build as followed:

```auto
{
          "Id": "Floor",
          "IdType": "string",
          "Value": "",
          "Unit": "none",
}

```

And I would like to have a result which is built with the node's property "Id" as key and the node's property "Value" as value:

```auto
{
    //Id : Value
    "Floor": "XYZ"
}

```

---

<div class="post-metadata">

### Author: ![filantrop](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/filantrop/32/20927_2.png) [@filantrop](https://community.neo4j.com/u/filantrop)
#### Post date: [January 15, 2022, 11:47am UTC](https://community.neo4j.com/t/computed-property-names-in-neo4j/50421/2 "2022-01-15T11:47:18Z")

</div>

Hi klug,  
I hope this snippet of query can help you:

```auto
with obj.Id as keyName

match (n)
where n[keyName] is not null
with n,keyName,n[keyName] as value
with apoc.map.fromPairs([[keyName,value]]) as ns
return ns

```

---

<div class="post-metadata">

### Author: ![klug](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/klug/32/6243_2.png) [@klug](https://community.neo4j.com/u/klug)
#### Post date: [January 17, 2022, 8:36am UTC](https://community.neo4j.com/t/computed-property-names-in-neo4j/50421/3 "2022-01-17T08:36:30Z")

</div>

Thanks @filantrop! The apoc function fromPairs is the perfect fit for my problem.  
Thanks for the fast and useful answer
