c2-mongoose 2.1.264 → 2.1.265
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.
|
@@ -284,6 +284,11 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
284
284
|
if (!Array.isArray(value)) {
|
|
285
285
|
value = [value];
|
|
286
286
|
}
|
|
287
|
+
value === null || value === void 0 ? void 0 : value.forEach(function (v) {
|
|
288
|
+
if (typeof v === 'string' && _this.isValidObjectId(v)) {
|
|
289
|
+
v = new mongoose_1.Types.ObjectId(v);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
287
292
|
if (key.startsWith("notIn")) {
|
|
288
293
|
key = key.replace("notIn", "");
|
|
289
294
|
condition[key] = { $nin: value };
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -256,6 +256,12 @@ class SearcherFlow<D> {
|
|
|
256
256
|
value = [value]
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
(value as [])?.forEach((v: any) => {
|
|
260
|
+
if (typeof v === 'string' && this.isValidObjectId(v)) {
|
|
261
|
+
v = new Types.ObjectId(v);
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
|
|
259
265
|
if (key.startsWith("notIn")) {
|
|
260
266
|
key = key.replace("notIn", "");
|
|
261
267
|
condition[key] = { $nin: value };
|