neo4j: Cypher LOAD CSV with uuid

旧街凉风 提交于 2019-12-05 17:53:46

Not sure where you've seen that {uuid} is a function. It is just using whatever you pass in as an parameter "uuid".

You'd have to generate a uuid when creating your CSV. In cypher there is currently no uuid() function.

One workaround that you could do is:

LOAD CSV FROM "file:..." AS csvLine
CREATE (c:Customer { name: csvLine[0], code: csvLine[1]})
SET c.id = id(c)

You could also use the GraphAware UUID Module.

All you would have to do is drop the framework jar and the uuid module jar into the plugins directory, add the following 2 lines into neo4j.properties, and restart Neo4j.

com.graphaware.runtime.enabled=true
com.graphaware.module.UIDM.1=com.graphaware.module.uuid.UuidBootstrapper

Any new node (no matter how it is created) will automatically get a UUID.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!