Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-04-2019 07:39 PM
Hi,
I have a graph database. The nodes in the graph suppose to be connected based on the order of the given property values. For example, the graph nodes can be:
(a{p:1}) (b{p:3}) (c{p:6}) (d{p:8})
then the connections suppose to be:
a--b--c--d
according to the order of the p value.
Where the problem is that the p values are randomly given.
So, how can I create the relationships between the nodes by Cypher?
Could you guys give me any suggestions? Thanks a lot!
Solved! Go to Solution.
12-05-2019 04:19 AM
HI @hn.chen , apoc is a kind of plugin which you can install in your db ..it has lof of useful functions ..
know more about apoc here : https://neo4j.com/docs/labs/apoc/current/
12-04-2019 10:10 PM
MATCH (n:NodeLabel)
WITH n ORDER BY n.propertyValue
WITH COLLECT(n) as nodeList
CALL apoc.nodes.link(nodeList,"RELATIONSHIPTYPE")
RETURN nodeList
12-05-2019 03:52 AM
Hi @ganesanmithun323, thanks for your answer. While could you give more explanations for the apoc.nodes.link operation. Neo4j is a pretty new platform for me. Thanks a lot!
12-05-2019 04:19 AM
HI @hn.chen , apoc is a kind of plugin which you can install in your db ..it has lof of useful functions ..
know more about apoc here : https://neo4j.com/docs/labs/apoc/current/
All the sessions of the conference are now available online