diff --git a/src/index.js b/src/index.js index e597e98..2460280 100644 --- a/src/index.js +++ b/src/index.js @@ -142,11 +142,11 @@ function filterQuery (resourceConfig, params) { } if (params.skip) { - query = query.offset(params.offset) + query = query.offset(+params.offset) } if (params.limit) { - query = query.limit(params.limit) + query = query.limit(+params.limit) } return query diff --git a/test/findAll.spec.js b/test/findAll.spec.js index d193415..4cbcfa7 100644 --- a/test/findAll.spec.js +++ b/test/findAll.spec.js @@ -168,6 +168,8 @@ describe('DSSqlAdapter#findAll', function () { assert.equal(comments[0].content, 'test1'); }); - + it('should allow passing limit and offset as strings', function* () { + var user = yield adapter.findAll(User, {limit: '10', offset: '20'}); + }); });