Skip to content

Instantly share code, notes, and snippets.

@mikecrittenden
Last active Sep 3, 2020
Embed
What would you like to do?
Parse and import a JS array into neo4j via the neo4j-driver
const session = driver.session()
const query = `WITH $data AS values
UNWIND values AS item
MERGE (thing:Thing {id: item.id})
SET thing.title = item.title`
session
.run(query, { data: yourArrayHere })
.catch((error) => {
console.error("Error syncing data: ", error)
})
.then(() => {
session.close()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment