@go-mailer/jarvis 3.2.6 → 3.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/query.js +10 -5
- package/package.json +1 -1
package/lib/query.js
CHANGED
|
@@ -123,11 +123,16 @@ const buildWildcardOptions = (key_list, value) => {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
const determinePagination = (page = 0, population
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
const determinePagination = (page = 0, population) => {
|
|
127
|
+
const pagination = {
|
|
128
|
+
skip: population ? skip * population : skip
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (population) {
|
|
132
|
+
pagination.limit = Number(population)
|
|
130
133
|
}
|
|
134
|
+
|
|
135
|
+
return pagination
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
const generateGroupPipeline = ({ group_by, seek_conditions, sort_condition, skip, limit, fields_to_return, count }) => {
|
|
@@ -148,7 +153,7 @@ const generateGroupPipeline = ({ group_by, seek_conditions, sort_condition, skip
|
|
|
148
153
|
|
|
149
154
|
if (limit) {
|
|
150
155
|
pipeline.push({
|
|
151
|
-
$limit: { limit }
|
|
156
|
+
$limit: { limit: Math.floor(limit) }
|
|
152
157
|
})
|
|
153
158
|
}
|
|
154
159
|
|