How to create or merge dynamicaly properties of relation?

My "relation" table in my DB is follow :

Initial insertion Value of updating
id_origin_node id_node_destination propertie property_value other_prop Value_other_prop
1 2 date 2016-10-23 City Montréal

My request is follow

It's not recognise the manner to pass dynamicaly property.

Please, need help?

A neo4j literal map will not evaluate your key value as a variable. It will use it as is. I suggest you use an apoc.map function to create the map and pass the resulting map as you parameters map.

I'm trying to find an example combining with other query like in an example, I can't find it. I tried hard without success...

You can do something like I did in the below screenshot to create your properties map for setting your relationship's properties.

Replace your "with" and "call apoc" lines with the following:

with value, row, apoc.map.fromValues([row.propertie,row.property_value]) as prop_map
call apoc.create.relationship(value.orig, "FOLLOW", prop_map, value.dest)

Yeah!!!!
Thank you very much, it works :slight_smile:
You are the best!

1 Like