From 2aa2d03086bc48435b0bb56ff91fee50c6d50ffc Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 5 Jun 2017 10:40:52 +1000 Subject: [PATCH] Exporting relationship properties --- cypher.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cypher.js b/cypher.js index ccf3608..4bd5a68 100644 --- a/cypher.js +++ b/cypher.js @@ -33,10 +33,11 @@ function cypher(model) { statements.push("(" + quote(node.id) +" :" + quote(node.caption() || "Node") + " " + render(props(node)) + ") "); }); model.relationshipList().forEach(function (rel) { + var propStr = " " + render(props(rel)); statements.push("(" + quote(rel.start.id) + - ")-[:`" + quote(rel.relationshipType()||"RELATED_TO") + - // " " + TODO render(props(rel)) + - "`]->("+ quote(rel.end.id) +")" + ")-[:`" + quote(rel.relationshipType()||"RELATED_TO") + "`" + + (propStr.length > 1 ? propStr : "") + + "]->("+ quote(rel.end.id) +")" ); }); if (statements.length==0) return "";