c2-mongoose 2.1.295 → 2.1.297

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.
@@ -223,14 +223,14 @@ var SearcherFlow = /** @class */ (function () {
223
223
  momentValue.hour(0);
224
224
  momentValue.minute(0);
225
225
  momentValue.second(0);
226
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.tz('America/Sao_Paulo', true).toDate() });
226
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.tz('America/Sao_Paulo', false).toDate() });
227
227
  }
228
228
  if ((0, Utils_1.isNotEmpty)(values[1])) {
229
229
  var momentValue = (0, moment_1.default)(values[1]);
230
230
  momentValue.hour(23);
231
231
  momentValue.minute(59);
232
232
  momentValue.second(59);
233
- condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo', true).toDate() });
233
+ condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo', false).toDate() });
234
234
  }
235
235
  }
236
236
  else if (key.endsWith('DateTimeRange')) {
@@ -331,7 +331,7 @@ var SearcherFlow = /** @class */ (function () {
331
331
  ].includes(key)) {
332
332
  return;
333
333
  }
334
- if (typeof value === 'string' && _this.isValidObjectId(value) && key !== 'owner') {
334
+ if (typeof value === 'string' && _this.isValidObjectId(value) && key !== 'owner' && key !== 'identifier') {
335
335
  value = new mongoose_1.Types.ObjectId(value);
336
336
  }
337
337
  if (value === 'true') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.295",
3
+ "version": "2.1.297",
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",
@@ -192,7 +192,7 @@ class SearcherFlow<D> {
192
192
  momentValue.second(0)
193
193
  condition[fieldName] = {
194
194
  ...condition[fieldName],
195
- $gte: momentValue.tz('America/Sao_Paulo', true).toDate()
195
+ $gte: momentValue.tz('America/Sao_Paulo', false).toDate()
196
196
  }
197
197
  }
198
198
 
@@ -203,7 +203,7 @@ class SearcherFlow<D> {
203
203
  momentValue.second(59)
204
204
  condition[fieldName] = {
205
205
  ...condition[fieldName],
206
- $lte: momentValue.tz('America/Sao_Paulo', true).toDate()
206
+ $lte: momentValue.tz('America/Sao_Paulo', false).toDate()
207
207
  }
208
208
  }
209
209
  } else if (key.endsWith('DateTimeRange')) {
@@ -251,8 +251,7 @@ class SearcherFlow<D> {
251
251
  if (key.startsWith("notIn")) {
252
252
  key = key.replace("notIn", "");
253
253
  condition[key] = { $nin: value };
254
- }
255
- else {
254
+ } else {
256
255
  condition[key] = { $in: value };
257
256
  }
258
257
  } else if (Array.isArray(value)) {
@@ -311,7 +310,7 @@ class SearcherFlow<D> {
311
310
  return
312
311
  }
313
312
 
314
- if (typeof value === 'string' && this.isValidObjectId(value as string) && key !== 'owner') {
313
+ if (typeof value === 'string' && this.isValidObjectId(value as string) && key !== 'owner' && key !== 'identifier') {
315
314
  value = new Types.ObjectId(value as string)
316
315
  }
317
316