Rivet.Utils.Criteria (rivet_utils v2.0.8)

View Source

Criteria is used for cursor based pagination.

Contributor: Brandon Gillespie

Summary

Functions

Function to apply the limit to the query (optional)

Function to apply the offset to the query (optional)

Function to order the collection by attribute and direction

Take out the :criteria item from the arguments Returns something like

Functions

limit(query, limit)

Function to apply the limit to the query (optional)

limit(query, arg2, limit)

offset(query, offset)

Function to apply the offset to the query (optional)

offset(query, arg2, offset)

order_by(query, arg)

Function to order the collection by attribute and direction

take(options \\ [], fun \\ fn -> ordering_by(nil) end)

Take out the :criteria item from the arguments Returns something like:

{:ok, %{limit: 500, offset: 1, sort: {"taskTitle", :asc}}}