Suppose I have this set of nodes:
{ uid: '0x1' }
{ uid: '0x2' }
{ uid: '0x3' }
{ uid: '0x4' }
{ uid: '0x5' }
{ uid: '0x6' }
{ uid: '0x7' }
{ uid: '0x8' }
Is it possible to query two at a time in descending uid order, always picking up where I left off?
query 1 results: [{ uid: '0x8' }, { uid: '0x7' }]
query 2 results: [{ uid: '0x6' }, { uid: '0x5' }]
query 3 results: [{ uid: '0x4' }, { uid: '0x3' }]
...
new node is inserted: { uid: '0x9' }
...
query 4 results: [{ uid: '0x2' }, { uid: '0x1' }]
I tried using first
with a negative number, but I can’t figure out how to use offset
properly when first
is negative.
I also tried using after
, but I can’t figure out how to make it work in reverse (i.e. in my case 0x7
is “after” 0x8
).