Nipun
Nipun

Reputation: 4319

Get property value from property name which is stored as value in another node

I have a query regarding neo4j cypher text

I have a property name of a node which is stored as value in another node. Like a filter node has 'TV_TYPE' as the value stored in its name field

{
Name : 'TV_TYPE'
}

Now this TV_TYPE is the property of another node. How can I get the value of this property in this node

{
TV_TYPE : "LCD"
}

I need to get LCD. How can I get it using cypher.

Upvotes: 0

Views: 181

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39925

With the current version of Neo4j dynamic property access is not possible. Therefore you need to split up your operation into two Cypher statements:

  1. the first fetches the property name TV_TYPE
  2. the second Cypher statement is built up using string concatenation

Maybe you can solve the problem more elegantly by converting the property name into a node. You'd have TV_TYPE then available as first class citizen in your graph.

Upvotes: 1

Related Questions