Is it possible to get total and paging data in one query? Say I have 100 total rows and my output looks like
{
"total": 100,
"list": [1, 3, 5, 7, 10]
}
I tried to achieve this with a query like
MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH u.uid as uids, count(u) as total
skip 0 limit 5
RETURN {list: collect(uids), total: total}
OR
MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH count(u) as total, u
WITH u.uid as uids, total
skip 0 limit 5
RETURN {list: collect(uids), total: total}
but the result looks like this
{
"total": 2,
"list": [
1
]
}
{
"total": 3,
"list": [
4,
3,
6,
7
]
}