Skip to content

Instantly share code, notes, and snippets.

@jasocox
Last active February 15, 2019 18:51
Show Gist options
  • Save jasocox/5b107ef0a13ae912acccf80b08d3e8a2 to your computer and use it in GitHub Desktop.
Save jasocox/5b107ef0a13ae912acccf80b08d3e8a2 to your computer and use it in GitHub Desktop.
Convert JSON into Cypher CREATE call
exports.generateCypherCreate = function(dataLabel, data) {
console.log("Data Label:", dataLabel);
var keys = Object.keys(data);
console.log("Keys:", keys);
var create = "CREATE (n: " + dataLabel " {";
create += keys.map( key => key + ": " + data[key]).join(", ");
create += "}) RETURN n";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment