c2-mongoose 2.1.410 → 2.1.412
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.
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var BuildRegexFlowItem_1 = __importDefault(require("../../v2/item/BuildRegexFlowItem"));
|
|
7
7
|
var ExtractFieldsOfTypeFlowItem_1 = __importDefault(require("../../v2/item/ExtractFieldsOfTypeFlowItem"));
|
|
8
|
-
var IsValidObjectIdFlowItem_1 = __importDefault(require("./IsValidObjectIdFlowItem"));
|
|
9
8
|
var BuildConditionSearchTextFlowItem = /** @class */ (function () {
|
|
10
9
|
function BuildConditionSearchTextFlowItem() {
|
|
11
10
|
}
|
|
12
11
|
BuildConditionSearchTextFlowItem.prototype.execute = function (filters, model) {
|
|
12
|
+
var _a;
|
|
13
13
|
// Recuperar todos os campos do tipo String
|
|
14
14
|
var conditions = undefined;
|
|
15
15
|
var camposString = !filters.searchTextFields ? ExtractFieldsOfTypeFlowItem_1.default.exec(model.schema, 'String') : filters.searchTextFields;
|
|
@@ -18,7 +18,7 @@ var BuildConditionSearchTextFlowItem = /** @class */ (function () {
|
|
|
18
18
|
var regex = BuildRegexFlowItem_1.default.exec(filters.searchText);
|
|
19
19
|
for (var _i = 0, camposString_1 = camposString; _i < camposString_1.length; _i++) {
|
|
20
20
|
var fieldString = camposString_1[_i];
|
|
21
|
-
if (
|
|
21
|
+
if (((_a = model.schema.path(fieldString)) === null || _a === void 0 ? void 0 : _a.instance) === "ObjectId") {
|
|
22
22
|
var conditionAux_1 = {};
|
|
23
23
|
conditionAux_1["$expr"] = {
|
|
24
24
|
"$regexMatch": {
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ class BuildConditionSearchTextFlowItem {
|
|
|
14
14
|
|
|
15
15
|
for (let fieldString of camposString) {
|
|
16
16
|
|
|
17
|
-
if (
|
|
17
|
+
if (model.schema.path(fieldString)?.instance === "ObjectId") {
|
|
18
18
|
let conditionAux: { [key: string]: any } = {}
|
|
19
19
|
conditionAux["$expr"] = {
|
|
20
20
|
"$regexMatch": {
|