type GetManyWithTotalsOptions
Description
GetManyWithTotalsOptions is a type that controls getManyWithTotals.
Definition
Defaults:
disableTotalsCalculation = falseloadAll = falseincludeOrderBy = false
type GetManyWithTotalsOptions = {
disableTotalsCalculation?: boolean;
loadAll?: boolean;
includeOrderBy?: boolean;
};
disableTotalsCalculation: skip thegetCount()query;totalis returned asnull. The page query then asks forpageSize + 1rows, sohasMoreis still known; the extra row is dropped fromlist.loadAll: load all matching rows without applying pagination;limitandoffsetare returned asnull.includeOrderBy: addorderByto the result, the SQL order the page was read in, for logs and debugging. Off by default, so a result passed on as an API response doesn't carry SQL.
Example
const { list, total } = await query.getManyWithTotals(
{ page: 1, pageSize: 50 },
{ disableTotalsCalculation: true } // GetManyWithTotalsOptions
);