# Update using Neo4j OGM

**URL:** <https://community.neo4j.com/t/update-using-neo4j-ogm/46276>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Tags:** cypher, ogm\
**Created:** [October 22, 2021, 2:45pm UTC](https://community.neo4j.com/t/update-using-neo4j-ogm/46276 "2021-10-22T14:45:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saravananraj2196](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/saravananraj2196/32/29412_2.png) [@saravananraj2196](https://community.neo4j.com/u/saravananraj2196)\
**Post date:** [October 22, 2021, 2:45pm UTC](https://community.neo4j.com/t/update-using-neo4j-ogm/46276/1 "2021-10-22T14:45:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gerrit.meier](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gerrit.meier/32/27374_2.png) [@gerrit.meier](https://community.neo4j.com/u/gerrit.meier)\
**Post date:** [October 27, 2021, 1:38pm UTC](https://community.neo4j.com/t/update-using-neo4j-ogm/46276/2 "2021-10-27T13:38:54Z")

</div>

As answered here [Discord](https://discord.com/channels/787399249741479977/816630778505986058/902621830106464356) , 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.
