Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-13-2019 04:43 AM
Dear All,
I am new to neo4j.FOr my project I have uploaded the data in ne04j.I have added created_time and modified_time as 2 property of the node.Now i want to build cypher query which would pull old those data which are modified 2 hr before.Can you share sample scirpt which would be helpful for me to fetch the data.
02-13-2019 04:58 PM
How did you store your dates? As date/time string, or did you use timestamp()? If you used timestamp, you could do something like this:
With (Timestamp()- 7200000) as newerthan
MATCH (n:label) where n.modified_time < newerthan
Return n
Couldn't test this, as I'm on my mobile right now
02-13-2019 10:10 PM
Hi Paul,
I did tried but it not working.Actually I had stored the time in datetime().So the above condition is not working.Can you suggest how can we fetch data which are last modified say 8 hr before from current time.
02-14-2019 08:02 AM
With (Timestamp()- 28800000) as olderthan
MATCH (n:Mynode) where datetime(n.modifiedtime).epochmillis < olderthan
return n
This will return nodes that were modified MORE THAN 8 hours prior to right now.
You may find it more convenient to store your timestamps converted to epoch, which makes it easier/faster to perform compare operations on them in your where clauses
02-13-2019 10:02 PM
I had stored the date in timestamp format.Thanks for suggestion Let me test confirm.
Thanks
02-16-2019 02:02 AM
Thanks for the solution Paul.
All the sessions of the conference are now available online