c2-mongoose 2.1.465 → 2.1.466

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.
@@ -15,9 +15,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var mongoose_1 = require("mongoose");
18
- var BuildConditionFlowItem_1 = __importDefault(require("../../v2/item/BuildConditionFlowItem"));
18
+ var BuildConditionFlowItem_1 = __importDefault(require("../../v3/item/BuildConditionFlowItem"));
19
19
  var BuildConditionSearchTextFlowItem_1 = __importDefault(require("./BuildConditionSearchTextFlowItem"));
20
- var IsValidObjectIdFlowItem_1 = __importDefault(require("../../v2/item/IsValidObjectIdFlowItem"));
20
+ var IsValidObjectIdFlowItem_1 = __importDefault(require("../../v3/item/IsValidObjectIdFlowItem"));
21
21
  var BuildAndQueriesFlowItem = /** @class */ (function () {
22
22
  function BuildAndQueriesFlowItem() {
23
23
  }
@@ -84,6 +84,18 @@ 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("Minimum")) {
88
+ key = key.replace("Minimum", "");
89
+ condition[key] = {
90
+ $gte: Number(value)
91
+ };
92
+ }
93
+ else if (key.endsWith("Maximum")) {
94
+ key = key.replace("Maximum", "");
95
+ condition[key] = {
96
+ $lte: Number(value)
97
+ };
98
+ }
87
99
  else if (key.endsWith("NotIn")) {
88
100
  key = key.replace("NotIn", "");
89
101
  var valuesArr = value === null || value === void 0 ? void 0 : value.trim().split(',').map(function (v) { return v.trim(); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.465",
3
+ "version": "2.1.466",
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",
@@ -1,7 +1,7 @@
1
1
  import mongoose, { Types } from "mongoose"
2
- import BuildConditionFlowItem from "../../v2/item/BuildConditionFlowItem"
2
+ import BuildConditionFlowItem from "../../v3/item/BuildConditionFlowItem"
3
3
  import BuildConditionSearchTextFlowItem from "./BuildConditionSearchTextFlowItem"
4
- import IsValidObjectIdFlowItem from "../../v2/item/IsValidObjectIdFlowItem"
4
+ import IsValidObjectIdFlowItem from "../../v3/item/IsValidObjectIdFlowItem"
5
5
 
6
6
  class BuildAndQueriesFlowItem {
7
7
  execute(filters: any, model: mongoose.Model<any>) {
@@ -80,6 +80,16 @@ 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("Minimum")) {
84
+ key = key.replace("Minimum", "");
85
+ condition[key] = {
86
+ $gte: Number(value)
87
+ };
88
+ } else if (key.endsWith("Maximum")) {
89
+ key = key.replace("Maximum", "");
90
+ condition[key] = {
91
+ $lte: Number(value)
92
+ };
83
93
  } else if (key.endsWith("NotIn")) {
84
94
  key = key.replace("NotIn", "");
85
95
  var valuesArr = value?.trim().split(',').map((v: string) => v.trim());