c2-mongoose 2.1.421 → 2.1.423
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.
- package/dist/flow/searcher/v3/item/BuildConditionSearchTextFlowItem.js +1 -1
- package/dist/flow/searcher/v3/item/PopulateFlowItem.js +1 -1
- package/package.json +1 -1
- package/src/flow/searcher/v3/item/BuildConditionSearchTextFlowItem.ts +1 -1
- package/src/flow/searcher/v3/item/PopulateFlowItem.ts +1 -1
|
@@ -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 (((_a = model.schema.path(fieldString)) === null || _a === void 0 ? void 0 : _a.instance) === "ObjectId") {
|
|
21
|
+
if (fieldString.endsWith("_id") || ((_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": {
|
|
@@ -30,7 +30,7 @@ var PopulateFlowItem = /** @class */ (function () {
|
|
|
30
30
|
if (!fieldDefinition)
|
|
31
31
|
return;
|
|
32
32
|
var typeFirst = fieldDefinition.instance;
|
|
33
|
-
if (typeFirst === 'Array') {
|
|
33
|
+
if (typeFirst === 'Array' && (rest === null || rest === void 0 ? void 0 : rest.length)) {
|
|
34
34
|
populateClauses = __spreadArray(__spreadArray([], populateClauses, true), LookupArrayFlowItem_1.default.execute(first, rest, populateClauses, modelRoot), true);
|
|
35
35
|
return;
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ class BuildConditionSearchTextFlowItem {
|
|
|
14
14
|
|
|
15
15
|
for (let fieldString of camposString) {
|
|
16
16
|
|
|
17
|
-
if (model.schema.path(fieldString)?.instance === "ObjectId") {
|
|
17
|
+
if ((fieldString as string).endsWith("_id") || model.schema.path(fieldString)?.instance === "ObjectId") {
|
|
18
18
|
let conditionAux: { [key: string]: any } = {}
|
|
19
19
|
conditionAux["$expr"] = {
|
|
20
20
|
"$regexMatch": {
|
|
@@ -19,7 +19,7 @@ class PopulateFlowItem {
|
|
|
19
19
|
|
|
20
20
|
let typeFirst = fieldDefinition.instance
|
|
21
21
|
|
|
22
|
-
if (typeFirst === 'Array') {
|
|
22
|
+
if (typeFirst === 'Array' && rest?.length) {
|
|
23
23
|
populateClauses = [...populateClauses, ...LookupArrayFlowItem.execute(first, rest, populateClauses, modelRoot)]
|
|
24
24
|
return
|
|
25
25
|
}
|