diff --git a/config/query-classes.js b/config/query-classes.js index ae6153fc0..4f0ef66a7 100644 --- a/config/query-classes.js +++ b/config/query-classes.js @@ -540,12 +540,15 @@ export class Query { } } else if (operator === OPERATOR_LIMIT) { const limit = parseInt(value, 10); - if (isNaN(limit) || limit < 1) { + if (isNaN(limit) || limit < 0) { this.addError(OPERATOR_LIMIT, { tag: 'operator-limit-invalid', value, }); continue; + } else if (limit == 0) { + // no limit + continue; } else { value = limit; } diff --git a/server/publications/cards.js b/server/publications/cards.js index 6430a2720..60fb2ccda 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -562,8 +562,10 @@ function buildProjection(query) { sort: 1, }, skip, - limit, }; + if (limit > 0) { + projection.limit = limit; + } if (query.getQueryParams().hasOperator(OPERATOR_SORT)) { const order =