From 0e959c76d8ba61a286d4ea73534bab1805e17c66 Mon Sep 17 00:00:00 2001 From: Birm Date: Wed, 24 Apr 2024 10:18:52 -0400 Subject: [PATCH] parse int for page size --- service/database/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/service/database/index.js b/service/database/index.js index 377492a..8692d7b 100644 --- a/service/database/index.js +++ b/service/database/index.js @@ -26,6 +26,7 @@ class Mongo { const collection = getConnection(database).collection(collectionName); let { _page = 0, _pageSize = 1000, ...filterQuery } = query; const _skip = _page * _pageSize; + _pageSize = parseInt(_pageSize, 10); const data = await collection.find(filterQuery).skip(_skip).limit(_pageSize).toArray(); /** allow caller method to toggle response transformation */