From 6ab7d8dbbd18d1e4f08267a8fd114476b4a7f1cb Mon Sep 17 00:00:00 2001 From: kenjones Date: Thu, 7 Jan 2016 08:53:50 -0500 Subject: [PATCH] fix(handlers): Map offset to skip for Mongoose 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. --- handlers/templates/_handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/templates/_handler.js b/handlers/templates/_handler.js index c143797..9f92540 100644 --- a/handlers/templates/_handler.js +++ b/handlers/templates/_handler.js @@ -132,7 +132,7 @@ module.exports = { case 'offset': if (!_.isUndefined(item) && !_.isNaN(_.parseInt(item))) { - options[key] = _.parseInt(item); + options['skip'] = _.parseInt(item); } break;