Search code examples
neo4jgraphawareneo4j-php-ogm

return the value uuid in the nodes created in Neo4j ogm


I'm working Neo4j from PHP. To generate the uuid field in the nodes I am using: neo4j-uuid. I also use: graphaware/neo4j-php-ogm, when I create a node, I do not return the value assigned to the UUID field, I have to make a new query to get that value, I need to hydrate the UUID value automatically when the object is created, just like the ID is hydrated.


Solution

  • From the GraphAware Neo4j UUID Github Repo:

    If you create a node and return it immediately, its contents will not reflect changes performed by transaction event handlers such as this one -- thus the UUID will not be available. A separate call must be made to get the UUID.

    That is: this is the expected behavior. Currently you should make a new query to get the node with the generated UUID property.