Last active
February 15, 2019 18:51
-
-
Save jasocox/5b107ef0a13ae912acccf80b08d3e8a2 to your computer and use it in GitHub Desktop.
Convert JSON into Cypher CREATE call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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