Skip to main content
shoppy.collections.before(cursor)
Sets the cursor for backward pagination. Use to fetch the previous page.
This is a chainable method. Call .list() to execute.

Parameters

ParamTypeRequiredDescription
cursorstringYespageInfo.startCursor from current response

Returns

CollectionsQueryBuilder (chainable)

Examples

Go back one page

const previousPage = await shoppy.collections
    .limit(10)
    .before(currentPage.pageInfo.startCursor)
    .list()
const previousPage = await shoppy.collections
    .search('sale')
    .limit(10)
    .before(currentPage.pageInfo.startCursor)
    .list()