c2-mongoose 2.1.184 → 2.1.185

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.
@@ -498,6 +498,11 @@ var SearchFlow = /** @class */ (function () {
498
498
  condition[fieldName] = _this.buildRegex(value); //{ $regex: value as any, $options: 'i' }
499
499
  filters.$and.push(condition);
500
500
  }
501
+ else if (key.endsWith('NotExist')) {
502
+ var fieldName = key.replace('NotExist', '');
503
+ condition[fieldName] = { $exists: false };
504
+ filters.$and.push(condition);
505
+ }
501
506
  else {
502
507
  if (!Array.isArray(value)) {
503
508
  condition[key] = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.184",
3
+ "version": "2.1.185",
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",
@@ -447,7 +447,13 @@ abstract class SearchFlow {
447
447
  var fieldName = key.replace('Like', '')
448
448
  condition[fieldName] = this.buildRegex(value as string) //{ $regex: value as any, $options: 'i' }
449
449
  filters.$and.push(condition)
450
- } else {
450
+ } else if (key.endsWith('NotExist')) {
451
+ var fieldName = key.replace('NotExist', '')
452
+ condition[fieldName] = { $exists: false }
453
+ filters.$and.push(condition)
454
+ }
455
+
456
+ else {
451
457
  if (!Array.isArray(value)) {
452
458
  condition[key] = value
453
459
  } else {