c2-mongoose 2.1.35 → 2.1.36

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.
@@ -220,7 +220,7 @@ var SearchFlow = /** @class */ (function () {
220
220
  sort = this.buildOrdenation();
221
221
  return [4 /*yield*/, model.aggregate([
222
222
  {
223
- '$match': this.filters
223
+ $match: this.filters
224
224
  },
225
225
  {
226
226
  $group: {
@@ -258,14 +258,14 @@ var SearchFlow = /** @class */ (function () {
258
258
  momentValue.hour(0);
259
259
  momentValue.minute(0);
260
260
  momentValue.second(0);
261
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.format("YYYY-MM-DD HH:mm") });
261
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.toDate() });
262
262
  }
263
263
  if ((0, Utils_1.isNotEmpty)(values[1])) {
264
264
  var momentValue = (0, moment_1.default)(values[1]);
265
265
  momentValue.hour(23);
266
266
  momentValue.minute(59);
267
267
  momentValue.second(59);
268
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.format("YYYY-MM-DD HH:mm") });
268
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.toDate() });
269
269
  }
270
270
  filters.$and.push(condition);
271
271
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.35",
3
+ "version": "2.1.36",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -139,7 +139,7 @@ abstract class SearchFlow {
139
139
  const ret = await model.aggregate(
140
140
  [
141
141
  {
142
- '$match': this.filters
142
+ $match: this.filters
143
143
  },
144
144
  {
145
145
  $group: {
@@ -176,7 +176,7 @@ abstract class SearchFlow {
176
176
  momentValue.second(0)
177
177
  condition[fieldName] = {
178
178
  ...condition[fieldName],
179
- $gte: momentValue.format("YYYY-MM-DD HH:mm")
179
+ $gte: momentValue.toDate()
180
180
  }
181
181
  }
182
182
 
@@ -187,7 +187,7 @@ abstract class SearchFlow {
187
187
  momentValue.second(59)
188
188
  condition[fieldName] = {
189
189
  ...condition[fieldName],
190
- $lte: momentValue.format("YYYY-MM-DD HH:mm")
190
+ $lte: momentValue.toDate()
191
191
  }
192
192
  }
193
193
  filters.$and.push(condition)