I am trying to create a node only if the key exists in my json file. However, it is only able to create some nodes but not all
call apoc.load.json($url) yield value
unwind value as q
merge (report:Report {filename:q.filename})
ON CREATE SET report.title = q.title,
report.published_date = q.published_date
// HASHES
with report, value
unwind value.hashes as hashes_obj
with report, value, hashes_obj
where hashes_obj.sha1 is not null
merge (hash_sha1: Hash_sha1 {sha1: hashes_obj.sha1}) // I am able to create this node
merge (report)-[:contains]->(hash_sha1)
// I can't create this node
with report, value, hashes_obj, hash_sha1
where hashes_obj.md5 is not null
merge (hash_md5: Hash_md5 {md5: hashes_obj.md5})
Below is my json file
{
...
"hashes": [
{
"sha1": "c61b53b85c538dc46254c4f1da7717a29a3b27f3",
"file_name": "jsunpack.je",
"is_ssl": false
},
],
...
}
{
...
"hashes": [
{
"md5": "a90a329335fa0af64d8394b28e0f86c1",
"is_ssl": false
},
{
"md5": "07f4b663cc3bcb5899edba9eaf9cf4b5",
"is_ssl": false
},
{
"md5": "b751323586c5e36d1d644ab42888a100",
"is_ssl": false
},
{
"md5": "8ad9cb6b948bcf7f9211887e0cf6f02a",
"file_name": "lsass.exe",
"is_ssl": false
},
{
"md5": "be0cc8411c066eac246097045b73c282",
"file_name": "mshtml.dll",
"is_ssl": false
}
]
...
}
For some reason, I can only create the sha1 node but not the md5 node and I'm not sure why. Please help me out?
I am using Neo4j desktop v4.