mirror of https://gitee.com/bigwinds/arangodb
27 lines
761 B
Plaintext
27 lines
761 B
Plaintext
!CHAPTER LIMIT
|
|
|
|
The *LIMIT* statement allows slicing the result array using an
|
|
offset and a count. It reduces the number of elements in the result to at most
|
|
the specified number. Two general forms of *LIMIT* are followed:
|
|
|
|
```
|
|
LIMIT count
|
|
LIMIT offset, count
|
|
```
|
|
|
|
The first form allows specifying only the *count* value whereas the second form
|
|
allows specifying both *offset* and *count*. The first form is identical using
|
|
the second form with an *offset* value of *0*.
|
|
|
|
The *offset* value specifies how many elements from the result shall be
|
|
discarded. It must be 0 or greater. The *count* value specifies how many
|
|
elements should be at most included in the result.
|
|
|
|
```
|
|
FOR u IN users
|
|
SORT u.firstName, u.lastName, u.id DESC
|
|
LIMIT 0, 5
|
|
RETURN u
|
|
```
|
|
|