Created
December 21, 2018 05:21
-
-
Save johnymontana/a669d4bf7e7c2725c6e810c87dbe0504 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CALL apoc.load.json("file:///Users/lyonwj/Desktop/pull_requests_000001.json") YIELD value | |
MERGE (pr:PullRequest {url: value.url}) | |
SET pr += value{created_at: DateTime(value.created_at), closed_at: DateTime(value.closed_at), merged_at: DateTime(value.merged_at), .title, .body } | |
MERGE (head:Repository {url: coalesce(value.head.repo,"")}) | |
MERGE (head)<-[h:HEAD]-(pr) | |
SET h = {sha: value.head.sha, ref: value.head.ref} | |
MERGE (base:Repository {url: value.base.repo}) | |
MERGE (base)<-[b:BASE]-(pr) | |
SET b = {sha: value.base.sha, ref: value.base.ref} | |
MERGE (u:User {url: value.user}) | |
MERGE (u)-[:OPENS]->(pr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment