Closed Marquis103 closed 10 years ago
e.g. with cypher CREATE (n) RETURN n.uuid
should work.
hey @sarmbruster thanks for the response. I definitely thought that'd work, but it returns null. Do you think it is an issue because i'm using milestone 06 of version 2.0?
You're right, Cypher statements do not return the uuid generated in the same statement:
create n return id(n), n.uuid
returns the node's id but not the uuid. A subsequent query returns the uuid:
start n=node(<previousId>) return n.uuid
The problem is that the uuid is applied in a TransactionEventHandler which is executed on transaction commit. At that time the cypher statement is already processed. Need to investigate what we can do about it. For now query the uuid in a separate statements as a workaround.
update: 1.9.x has the same behaviour.
neo4j-uuid was initially created for a non-cypher project.
No problem, I was just making sure I understood the functionality. If the uuid wasn't designed to work using cypher, it's not a big deal. Thanks for your time and development.
Hi @sarmbruster. Any news on this issue?
There is no way to solve this without applying larger changes inside Neo4j. Please feel free to raise a feature request with https://github.com/neo4j/neo4j/issues for making changes done in TransactionEventHandlers visible to Cypher's RETURN
clause.
Thanks a lot for clarifying this. On Apr 12, 2014 10:28 AM, "Stefan Armbruster" notifications@github.com wrote:
There is no way to solve this without applying larger changes inside Neo4j. Please feel free to raise a feature request with https://github.com/neo4j/neo4j/issues for making changes done in TransactionEventHandlers visible to Cypher's RETURN clause.
Reply to this email directly or view it on GitHubhttps://github.com/sarmbruster/neo4j-uuid/issues/1#issuecomment-40274054 .
How can I achieve this? If I go to my console and run a query that creates nodes or relationships the uuid creates successfully, but is there a way that I can return the UUID on object (node, relationship) creation?