cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Can we Run cypher query after one hour of its creation using triggers and apoc

I want to increase the post_views property of a node after one hour of its creation automatically.
Example-

  1. Create post
    Create (p:Post{uuid:"123",post_title:"test",post_views:0,created_at:timestamp()})
  2. Update the post_views to 50 after one hour.
    match (p:Post{uuid:"123"}) set p.post_views=abs(p.post_views+50)

My question is how I can automate this so that whenever a post is created in the database with Post Label after one hour of its creation automatically post_views is increased by 50.

2 REPLIES 2

Haven't used apoc.periodic.repeat myself before but looks ...

https://stackoverflow.com/questions/37505994/neo4j-query-run-at-specific-time
https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_further_functions

like it should do the job!

@paul.thomas Thanks for the answer these links really helped me