Skip to content

Commit

Permalink
Fix NoSQL builde.paginate() with empty limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Nov 21, 2017
1 parent 71000a2 commit ca9452c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
======= 2.9.1

- fixed: sitemap language auto-setting
- fixed: NoSQL: `builder.paginate()` a problem with zero limit (default limit will be `maxlimit`)

======= 2.9.0

Expand Down
3 changes: 3 additions & 0 deletions nosql.js
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,9 @@ DatabaseBuilder.prototype.paginate = function(page, limit, maxlimit) {
if (maxlimit && limit2 > maxlimit)
limit2 = maxlimit;

if (!limit2)
limit2 = maxlimit;

this.$skip = page2 * limit2;
this.$take = limit2;
return this;
Expand Down

0 comments on commit ca9452c

Please sign in to comment.