c2-mongoose 2.1.304 → 2.1.305

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.
@@ -261,7 +261,7 @@ var SearcherFlow = /** @class */ (function () {
261
261
  }
262
262
  else if (key.endsWith("IsEmpty")) {
263
263
  key = key.replace("IsEmpty", "");
264
- condition[key] = { $size: value ? 0 : { $gte: 1 } };
264
+ condition[key] = value ? { $size: 0 } : { $not: { $size: 0 } };
265
265
  }
266
266
  else {
267
267
  if (((_c = (_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.schema) === null || _b === void 0 ? void 0 : _b.paths[key]) === null || _c === void 0 ? void 0 : _c.instance) === 'Array') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.304",
3
+ "version": "2.1.305",
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",
@@ -238,7 +238,7 @@ class SearcherFlow<D> {
238
238
  condition[fieldName] = { $exists: value as boolean }
239
239
  } else if (key.endsWith("IsEmpty")) {
240
240
  key = key.replace("IsEmpty", "");
241
- condition[key] = { $size: value ? 0 : { $gte: 1 } };
241
+ condition[key] = value ? { $size: 0 } : { $not: { $size: 0 } };
242
242
  } else {
243
243
  if (this.model?.schema?.paths[key]?.instance === 'Array') {
244
244
  if (!Array.isArray(value)) {