How i can receive next or previous element in arango collection?

104 Views Asked by At

I have a document in ArangoDB. I need to receive the previous document. How can I receive the previous document in the Arango collection?

1

There are 1 best solutions below

1
On

My Way is:

FOR d IN MyCollection
    FILTER TO_NUMBER(d._key) < 512989295537
    SORT d._key DESC LIMIT 1
    RETURN d._key

But, I think it is not optimal...