c2-mongoose 2.1.280 → 2.1.282

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.
@@ -360,9 +360,10 @@ var SearcherFlow = /** @class */ (function () {
360
360
  if (objectSearch === null || objectSearch === void 0 ? void 0 : objectSearch.or) {
361
361
  Object.entries(objectSearch === null || objectSearch === void 0 ? void 0 : objectSearch.or).forEach(function (_a) {
362
362
  var key = _a[0], value = _a[1];
363
- console.log(key, value);
364
363
  if ((0, Utils_1.isEmpty)(value))
365
364
  return;
365
+ if (!filters.$or)
366
+ filters.$or = [];
366
367
  if (typeof value === 'string' && _this.isValidObjectId(value) && key !== 'owner') {
367
368
  value = new mongoose_1.Types.ObjectId(value);
368
369
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.280",
3
+ "version": "2.1.282",
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",
@@ -345,9 +345,10 @@ class SearcherFlow<D> {
345
345
 
346
346
  if (objectSearch?.or) {
347
347
  Object.entries(objectSearch?.or).forEach(([key, value]) => {
348
- console.log(key, value)
349
348
  if (isEmpty(value)) return
350
349
 
350
+ if (!filters.$or) filters.$or = []
351
+
351
352
  if (typeof value === 'string' && this.isValidObjectId(value as string) && key !== 'owner') {
352
353
  value = new Types.ObjectId(value as string)
353
354
  }