c2-mongoose 2.1.35 → 2.1.37
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/dist/flow/SearchFlow.js
CHANGED
|
@@ -220,7 +220,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
220
220
|
sort = this.buildOrdenation();
|
|
221
221
|
return [4 /*yield*/, model.aggregate([
|
|
222
222
|
{
|
|
223
|
-
|
|
223
|
+
$match: this.filters
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
$group: {
|
|
@@ -232,7 +232,9 @@ var SearchFlow = /** @class */ (function () {
|
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
$sort: sort
|
|
235
|
-
}
|
|
235
|
+
},
|
|
236
|
+
{ $skip: (this.page - 1) * this.limit },
|
|
237
|
+
{ $limit: this.limit }
|
|
236
238
|
]).session(session)];
|
|
237
239
|
case 1:
|
|
238
240
|
ret = _a.sent();
|
|
@@ -258,14 +260,14 @@ var SearchFlow = /** @class */ (function () {
|
|
|
258
260
|
momentValue.hour(0);
|
|
259
261
|
momentValue.minute(0);
|
|
260
262
|
momentValue.second(0);
|
|
261
|
-
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.
|
|
263
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.toDate() });
|
|
262
264
|
}
|
|
263
265
|
if ((0, Utils_1.isNotEmpty)(values[1])) {
|
|
264
266
|
var momentValue = (0, moment_1.default)(values[1]);
|
|
265
267
|
momentValue.hour(23);
|
|
266
268
|
momentValue.minute(59);
|
|
267
269
|
momentValue.second(59);
|
|
268
|
-
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.
|
|
270
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.toDate() });
|
|
269
271
|
}
|
|
270
272
|
filters.$and.push(condition);
|
|
271
273
|
}
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -139,7 +139,7 @@ abstract class SearchFlow {
|
|
|
139
139
|
const ret = await model.aggregate(
|
|
140
140
|
[
|
|
141
141
|
{
|
|
142
|
-
|
|
142
|
+
$match: this.filters
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
$group: {
|
|
@@ -151,7 +151,9 @@ abstract class SearchFlow {
|
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
$sort: sort
|
|
154
|
-
}
|
|
154
|
+
},
|
|
155
|
+
{ $skip: (this.page - 1) * this.limit },
|
|
156
|
+
{ $limit: this.limit }
|
|
155
157
|
]
|
|
156
158
|
).session(session!)
|
|
157
159
|
return ret
|
|
@@ -176,7 +178,7 @@ abstract class SearchFlow {
|
|
|
176
178
|
momentValue.second(0)
|
|
177
179
|
condition[fieldName] = {
|
|
178
180
|
...condition[fieldName],
|
|
179
|
-
$gte: momentValue.
|
|
181
|
+
$gte: momentValue.toDate()
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
|
|
@@ -187,7 +189,7 @@ abstract class SearchFlow {
|
|
|
187
189
|
momentValue.second(59)
|
|
188
190
|
condition[fieldName] = {
|
|
189
191
|
...condition[fieldName],
|
|
190
|
-
$lte: momentValue.
|
|
192
|
+
$lte: momentValue.toDate()
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
filters.$and.push(condition)
|