cancel
Showing results for 
Search instead for 
Did you mean: 

Update using Neo4j OGM

saravananraj219
Node Link

Hi All,
I'm using Neo4j OGM to store data. In my pojo I have two fields named createDate and modifiedDate.
When I insert a record createDate and modified Date are stored. When I try to update the record I have to modify the modifiedDate field alone and createDate should remain as such. But the value of createDate is set to null while updating. Due to this on update createDate field will be removed from record. So is there any way to not update the fields which does not have value in pojo?

Thanks.

1 REPLY 1

gerrit_meier
Neo4j
Neo4j

As answered here Discord , the property need to be set.
If Neo4j-OGM should persist a null value, it will remove the property from the node (set it to null in Neo4j definition).
The only ways to make it not delete the property is either loading it or using a custom Cypher query.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.