I have a node called (:Post) with a property called 'CreatedAt'.
The CreatedAt propery has a time value such as "2021-01-01T08:00:00Z".
What I want to do is to get the node counts between 10 minutes periods in all database.
I was able to find the solution for the days with the following query (even though it was super slow):
WITH date('2020-01-01') AS startDate, date('2020-02-01') AS endDate
WITH startDate, duration.inDays(startDate, endDate).days AS days
WITH [day in range(0, days) | startDate + duration({days: day})] AS dates
UNWIND dates AS date
MATCH (m:Post)
WHERE date(datetime(m.CreatedDate)) = date
RETURN date, COUNT(*) AS count
This query returns an output like this:
date count
"2021-09-10" 690
"2021-09-11" 701
I need an output like the following:
dateStart dateEnd count
"2021-09-10T08:00:00" "2021-09-10T08:10:00" 50
"2021-09-10T08:10:00" "2021-09-10T08:20:00" 40
"2021-09-10T08:20:00" "2021-09-10T08:30:00" 60
...
I would be appreciated for any kind of help as I was not able to find a solution for such challenge.