c2-mongoose 2.1.285 → 2.1.286

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.
@@ -383,9 +383,8 @@ var SearcherFlow = /** @class */ (function () {
383
383
  }
384
384
  var filtersFinal = {};
385
385
  if (andQueriesParam.length > 0) {
386
- if (!filtersFinal.$or)
387
- filtersFinal.$or = [];
388
- filtersFinal.$or = __spreadArray(__spreadArray([], filtersFinal.$or, true), [{ $and: __spreadArray([], andQueriesParam, true) }], false);
386
+ // if (!filtersFinal.$or) filtersFinal.$or = []
387
+ filtersFinal = __assign(__assign({}, filtersFinal), andQueriesParam);
389
388
  }
390
389
  if (orPayload.length > 0) {
391
390
  if (!filtersFinal.$or)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.285",
3
+ "version": "2.1.286",
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",
@@ -361,11 +361,10 @@ class SearcherFlow<D> {
361
361
  }
362
362
  }
363
363
 
364
- const filtersFinal = {} as any
365
-
364
+ let filtersFinal = {} as any
366
365
  if (andQueriesParam.length > 0) {
367
- if (!filtersFinal.$or) filtersFinal.$or = []
368
- filtersFinal.$or = [...filtersFinal.$or, { $and: [...andQueriesParam] }]
366
+ // if (!filtersFinal.$or) filtersFinal.$or = []
367
+ filtersFinal = { ...filtersFinal, ...andQueriesParam }
369
368
  }
370
369
 
371
370
  if (orPayload.length > 0) {