cancel
Showing results for 
Search instead for 
Did you mean: 

Neo4j plugin setProperty doesn't seem to work

Stef-van-Stipdo
Node Link

Given the following code I would expect every node which is created in the database to receive a property CreatedAt.
At the moment some nodes get the CreatedAt property, but others do not.

@Override
public Void beforeCommit(TransactionData data, Transaction transaction, GraphDatabaseService databaseService) throws Exception {
data.createdNodes().forEach(node -> {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ");

node.setProperty("CreatedAt", ZonedDateTime.now().format(formatter).toString());
});

return null;
}

It seems that sometimes nodes do not get the CreatedAt property, but other times they do.

Am I missing something here?

(Sorry if this is a really vague question, but I can't figure out a possible cause)

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online