Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
fix(handlers): Map offset to skip for Mongoose
Browse files Browse the repository at this point in the history
The standard for pagination parameters in REST include `offset`,
the corresponding option within mongoose/MongoDB is `skip`. This
change updates the handling of the `offset` option by mapping to the
`skip` mongoose option.
  • Loading branch information
kenjones-cisco committed Jan 7, 2016
1 parent 3a7c2e0 commit 6ab7d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/templates/_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = {

case 'offset':
if (!_.isUndefined(item) && !_.isNaN(_.parseInt(item))) {
options[key] = _.parseInt(item);
options['skip'] = _.parseInt(item);
}
break;

Expand Down

0 comments on commit 6ab7d8d

Please sign in to comment.