FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. For more details, review the migration guide. Contact support@fauna.com with any questions. |
Drop
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Drop( num, array )
drop( num, array )
Drop( num, array )
Drop( num, array )
Drop( num, array )
Description
The Drop
function returns a new array of the same type that
contains the remaining elements, after num
have been removed from the
head of the array. If num
is zero or negative, all elements of
the array are returned unmodified.
When applied to a Page, the returned page’s before
cursor is
adjusted to exclude the dropped elements. As special cases:
-
If
num
is negative,before
does not change. -
Otherwise if all elements from the original page were dropped (including the case where the page was already empty),
before
is set to same value as the original page’safter
.
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Array or Page |
The drop operations should be performed on this array. |
|
Integer |
The number of elements to extract from the beginning of the array. |
Examples
The following query creates a new array containing a copy of the last element of the array passed into the function:
[ 3 ]
[ 3 ]
[3]
Arr(LongV(3))
[ 3 ]
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!