module_data sorting, filtering and pagination

Introduction

When using module_data it is possible to sort, filter or paginate the data server-side before anything is sent to the browser. This allows fast
and secure access to the data stored in the back-end.

Note: With the flexibility module_data offers when accessing the server data its syntax can get pretty complicated. To make module_data
easier to work with we have introduced the
BC API Discovery app . This is a free tool that enables you to visually create complex queries you can
then copy-paste right in your site.

Let's take a look below at the methods you can use.

Remember: when using any of the methods below with module_data you will need to escape the curly and square brackets using a
backslash character.

Resource ordering

Each collection can be sorted (ascending and descending) using the order query parameter. Below is an example where we will get the list
of orders sorted in a descending order:

Examples

Using the skip and limit parameters you can paginate the output of module_data using only Liquid code (no javascript needed). Take a look at the Pagination for module_data tutorial for more information.