c2-mongoose 2.1.101 → 2.1.102

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.
@@ -460,13 +460,15 @@ var SearchFlow = /** @class */ (function () {
460
460
  condition[key] = value;
461
461
  }
462
462
  else {
463
+ var arr = [];
463
464
  for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
464
465
  var val = value_1[_i];
465
466
  if (typeof val === 'string' && _this.isValidObjectId(val)) {
466
467
  val = new mongoose_1.Types.ObjectId(val);
467
468
  }
469
+ arr.push(val);
468
470
  }
469
- condition[key] = { $in: value };
471
+ condition[key] = { $in: arr };
470
472
  }
471
473
  filters.$and.push(condition);
472
474
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.101",
3
+ "version": "2.1.102",
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",
@@ -385,13 +385,15 @@ abstract class SearchFlow {
385
385
  if (!Array.isArray(value)) {
386
386
  condition[key] = value
387
387
  } else {
388
- for(let val of value) {
388
+ let arr = []
389
+ for (let val of value) {
389
390
  if (typeof val === 'string' && this.isValidObjectId(val as string)) {
390
391
  val = new Types.ObjectId(val as string)
391
392
  }
393
+ arr.push(val)
392
394
  }
393
395
 
394
- condition[key] = { $in: value }
396
+ condition[key] = { $in: arr }
395
397
  }
396
398
  filters.$and.push(condition)
397
399
  }