使用 AQL /_api/cursor 而不是 /_api/simple/all 进行 Arangodb 分页

isw*_*wak 4 arangodb aql

Arangodb 有一个用于简单查询的 LIMIT 和 SKIP 函数,如何使用 /api/cursor 实现

FOR product in products
    LIMIT 2
return product
Run Code Online (Sandbox Code Playgroud)

理想情况下是这样的

FOR product in products
    LIMIT 20 SKIP 10
return product
Run Code Online (Sandbox Code Playgroud)

或者它只支持使用/_api/simple/all调用

isw*_*wak 6

我想我已经明白了,LIMIT 子句有一个偏移量、计数,可以用来跳过和实现分页。

LIMIT @offset, @count

FOR product in products
    LIMIT 2, 10
return product
Run Code Online (Sandbox Code Playgroud)