Reverse
Copied!
Reverse( source )
Returns
Examples
-
The following query passes an array to
Reverse
:[ 3, 2, 1, 'c', 'b', 'a' ]
-
The following query reverses the set of documents in the
Letters
collection (established in the Indexing tutorial, and then paginates the set:{ data: [ Ref(Collection("Letters"), "126"), Ref(Collection("Letters"), "125"), Ref(Collection("Letters"), "124"), Ref(Collection("Letters"), "123"), Ref(Collection("Letters"), "122"), Ref(Collection("Letters"), "121"), Ref(Collection("Letters"), "120"), Ref(Collection("Letters"), "119"), Ref(Collection("Letters"), "118"), Ref(Collection("Letters"), "117"), Ref(Collection("Letters"), "116"), Ref(Collection("Letters"), "115"), Ref(Collection("Letters"), "114"), Ref(Collection("Letters"), "113"), Ref(Collection("Letters"), "112"), Ref(Collection("Letters"), "111"), Ref(Collection("Letters"), "110"), Ref(Collection("Letters"), "109"), Ref(Collection("Letters"), "108"), Ref(Collection("Letters"), "107"), Ref(Collection("Letters"), "106"), Ref(Collection("Letters"), "105"), Ref(Collection("Letters"), "104"), Ref(Collection("Letters"), "103"), Ref(Collection("Letters"), "102"), Ref(Collection("Letters"), "101") ] }
-
The following query reverses the page of results from paginating the documents in the
Letters
collection:{ before: [ Ref(Collection("Letters"), "104") ], after: [ Ref(Collection("Letters"), "107") ], data: [ Ref(Collection("Letters"), "106"), Ref(Collection("Letters"), "105"), Ref(Collection("Letters"), "104") ] }
Notice that
Reverse
has reversed the order of the results in the page, but has not affected the pagination order.
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!