Search code examples
arangodbaql

Retrieve all documents from ArangoDB collection, with an offset


Is there a way to retrieve all documents, but with an offset? or do I need to specify the amount of doucments i want?

For example:

LIMIT 5,"ALL" 

to retrieve all documents except the first 5.


Solution

  • There is no "all" option for limit but you can either:

    1. Put a large number as the second parameter if you have an idea of the max number records in the table

    2. Use the Minus function as follows:

    .

    FOR x IN MINUS (
        (FOR t IN test1
        RETURN t ),
        (FOR t IN test1 
        LIMIT 5
        RETURN t )
    )
    RETURN x