Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-24-2021 11:37 PM
Hi All,
Is there anyway to update an existing attribute in a node to a new value after a specific time period passes ?
For example:
Node 'Offer' has the below attributes
Process:
I do know that there is TTL , but I don't want my node to be deleted after 7 days but rather the attribute to be updated to "No" from "Yes"
Is there any way I can achieve this in Neo4j?
01-29-2021 04:07 PM
Hmm you could perhaps run a periodic job inside or outside of the database
that matches are all the nodes that are currently due (i.e. where the createdOn property >= 7 days ago and IS_VALID is Yes
externally cron or any other scheduler
internally apoc.periodic.repeat (but have to re-issue after restarts)
02-07-2021 05:19 PM
Hi Michael, thanks for your response. I also found that there is apoc.periodic.schedule. However both iterate and schedule doesn't really solve my problem as each offer can be created at any time and I need to know exactly when to update the status.
For now I have created a new attribute in the node as expired_time, and I'm populating this the moment offer node is being created. And I'll only display those offer nodes when current_time < expired_time
So to confirm, there are no record level triggers available in Ne04j ?
02-08-2021 12:37 AM
There are triggers in apoc that are called on data changes.
They are not super efficient though.
All the sessions of the conference are now available online