c2-mongoose 2.1.301 → 2.1.302

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.
@@ -279,7 +279,7 @@ var SearcherFlow = /** @class */ (function () {
279
279
  }
280
280
  else if (key.endsWith("IsEmpty")) {
281
281
  key = key.replace("IsEmpty", "");
282
- condition[key] = { $size: 0 };
282
+ condition[key] = { $size: value ? 0 : { $gte: 1 } };
283
283
  }
284
284
  else {
285
285
  condition[key] = { $in: value };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.301",
3
+ "version": "2.1.302",
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",
@@ -256,7 +256,7 @@ class SearcherFlow<D> {
256
256
  condition[key] = { $nin: value };
257
257
  } else if (key.endsWith("IsEmpty")) {
258
258
  key = key.replace("IsEmpty", "");
259
- condition[key] = { $size: 0 };
259
+ condition[key] = { $size: value ? 0 : { $gte: 1 } };
260
260
  } else {
261
261
  condition[key] = { $in: value };
262
262
  }