Reputation: 793
I am creating a text file to then Bulk insert into Neo4j. This is working EXCEPT the nodes are not labeled. The file I am loading has this text:
[{"method":"POST","to":"/node","body":{"ICD9":"79409","NodeType":"Dx","ID":2},"metadata":{"labels":["Dx"]}}]
What should it look like to create the label "Dx"?
I can use set after creating the nodes but this is slow and may time out.
Upvotes: 0
Views: 233
Reputation: 39915
According to the docs of the Neo4j REST API, there's no direct way to create a node with label(s). Since you're already using batches, it's fairly simple to add another call for adding a label to your request:
[
{
"method":"POST",
"to":"/node",
"id": 0,
"body":{"ICD9":"79409","NodeType":"Dx","ID":2}
},
{
"method":"POST",
"to":"{0}/labels",
"id": 1,
"body": "Dx"
}
]
Since you've already put a label on the node, consider omitting the NodeType
property - it seems to be redundant.
Upvotes: 1