I am new to Neo4j and Cypher. Currently I am using Neo4j Desktop and try to develop my company's internal system.
Now, there are multiple Employee nodes have age property. I want all age property to automatically count up on April 1 every year.
Do you have any idea to solve this issue?
I think it is possible to use the APOC trigger to update to April.
Better yet, if you have a birthday property then you don't need to handle the count up.
Never ever try to save in a database a state which is changing all the time. Go for the "fixed point in the universe".
You may save someone's birthday, then you will be able to get his/her age at every time.
Actually I want to add birthday as property, but I can' t do it from perspective of personal information security. So there are no other way but to add age property.
I know I can use apoc trigger, but I don't know how to run Cypher statement to automatically count up age property. So Would you tell me how to do it?
I ran into a similar issue once, and keeping derived values updated automatically turned out to be the tricky part.
A useful takeaway is to define a scheduled update process early so properties stay accurate, much like happy birthday wishes to police officer are best planned before the date arrives.