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