I want to display a single post of each user on each page in descending order by CreatedDateTime.
If John has created three posts
Post A at 09:00 31-Jan
Post B at 10:00 31-Jan
Post C at 11:00 31 Jan
So the required output shoud be
Page 1 should display Post C
Page 2 should display Post B
Page 3 should display Post A
This means there will be 20 posts for 20 different users on a single page.
So far I wrote this query which displays all the posts on page one.
MATCH (p:Posts)-[:CREATED_BY]->(u:User) WHERE p.CreatedDateTime >= datetime('2021-01-31') RETURN p, u ORDER BY datetime(p.CreatedDateTime) DESC SKIP 0 LIMIT 20
I know, need to use some subquery but don't have clue how to do that.