c2-mongoose 2.1.464 → 2.1.465

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.
@@ -84,6 +84,16 @@ var BuildConditionFlowItem = /** @class */ (function () {
84
84
  key = key.replace("IsEmpty", "");
85
85
  condition[key] = value ? { $size: 0 } : { $not: { $size: 0 } };
86
86
  }
87
+ else if (key.endsWith("NotIn")) {
88
+ key = key.replace("NotIn", "");
89
+ var valuesArr = value === null || value === void 0 ? void 0 : value.trim().split(',').map(function (v) { return v.trim(); });
90
+ condition[key] = { $nin: valuesArr };
91
+ }
92
+ else if (key.endsWith("In")) {
93
+ key = key.replace("In", "");
94
+ var valuesArr = value === null || value === void 0 ? void 0 : value.trim().split(',').map(function (v) { return v.trim(); });
95
+ condition[key] = { $in: valuesArr };
96
+ }
87
97
  else {
88
98
  if (((_c = (_b = model === null || model === void 0 ? void 0 : model.schema) === null || _b === void 0 ? void 0 : _b.paths[key]) === null || _c === void 0 ? void 0 : _c.instance) === 'Array') {
89
99
  if (!Array.isArray(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.464",
3
+ "version": "2.1.465",
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",
@@ -80,6 +80,14 @@ class BuildConditionFlowItem {
80
80
  } else if (key.endsWith("IsEmpty")) {
81
81
  key = key.replace("IsEmpty", "");
82
82
  condition[key] = value ? { $size: 0 } : { $not: { $size: 0 } };
83
+ } else if (key.endsWith("NotIn")) {
84
+ key = key.replace("NotIn", "");
85
+ var valuesArr = value?.trim().split(',').map((v: string) => v.trim());
86
+ condition[key] = { $nin: valuesArr };
87
+ } else if (key.endsWith("In")) {
88
+ key = key.replace("In", "");
89
+ var valuesArr = value?.trim().split(',').map((v: string) => v.trim());
90
+ condition[key] = { $in: valuesArr };
83
91
  } else {
84
92
  if (model?.schema?.paths[key]?.instance === 'Array') {
85
93
  if (!Array.isArray(value)) {