c2-mongoose 2.1.171 → 2.1.173

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.
@@ -261,7 +261,12 @@ var SearchFlow = /** @class */ (function () {
261
261
  {
262
262
  $facet: facet
263
263
  },
264
- ]).session(options === null || options === void 0 ? void 0 : options.session)];
264
+ ], {
265
+ collation: {
266
+ locale: "pt_BR",
267
+ numericOrdering: true
268
+ }
269
+ }).session(options === null || options === void 0 ? void 0 : options.session)];
265
270
  case 1:
266
271
  result = _d.sent();
267
272
  if (!((0, Utils_1.isNotEmpty)(this.populate) && Array.isArray(this.populate))) return [3 /*break*/, 5];
@@ -452,7 +457,7 @@ var SearchFlow = /** @class */ (function () {
452
457
  momentValue.hour(0);
453
458
  momentValue.minute(0);
454
459
  momentValue.second(0);
455
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gt: momentValue.toDate() });
460
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.toDate() });
456
461
  }
457
462
  if ((0, Utils_1.isNotEmpty)(values[1])) {
458
463
  var momentValue = (0, moment_1.default)(values[1]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.171",
3
+ "version": "2.1.173",
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",
@@ -238,8 +238,12 @@ abstract class SearchFlow {
238
238
  {
239
239
  $facet: facet
240
240
  },
241
- ]
242
- ).session(options?.session as ClientSession)
241
+ ], {
242
+ collation: {
243
+ locale: "pt_BR",
244
+ numericOrdering: true
245
+ }
246
+ }).session(options?.session as ClientSession)
243
247
 
244
248
  if (isNotEmpty(this.populate) && Array.isArray(this.populate)) {
245
249
  for (var populate of this.populate) {
@@ -398,7 +402,7 @@ abstract class SearchFlow {
398
402
  momentValue.second(0)
399
403
  condition[fieldName] = {
400
404
  ...condition[fieldName],
401
- $gt: momentValue.toDate()
405
+ $gte: momentValue.toDate()
402
406
  }
403
407
  }
404
408
 
@@ -432,7 +436,7 @@ abstract class SearchFlow {
432
436
  if (key.startsWith("notIn")) {
433
437
  key = key.replace("notIn", "")
434
438
  condition[key] = { $nin: arr }
435
- }else{
439
+ } else {
436
440
  condition[key] = { $in: arr }
437
441
  }
438
442