c2-mongoose 2.1.69 → 2.1.72
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/SearchFlow.js
CHANGED
|
@@ -112,7 +112,9 @@ var SearchFlow = /** @class */ (function () {
|
|
|
112
112
|
var projection = {};
|
|
113
113
|
for (var _i = 0, _a = this.select; _i < _a.length; _i++) {
|
|
114
114
|
var field = _a[_i];
|
|
115
|
-
|
|
115
|
+
if (field.indexOf(".")) {
|
|
116
|
+
projection[field] = 1;
|
|
117
|
+
}
|
|
116
118
|
}
|
|
117
119
|
return projection;
|
|
118
120
|
};
|
|
@@ -141,7 +143,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
141
143
|
var populate = this_1.buildPath(first, nested);
|
|
142
144
|
if (Array.isArray(this_1.select)) {
|
|
143
145
|
var selects = this_1.select.filter(function (sel) { return sel.startsWith("".concat(first, ".")); });
|
|
144
|
-
populate.select = selects.map(function (sel) { return sel.split(".")[
|
|
146
|
+
populate.select = selects.map(function (sel) { return sel.split(".")[1]; }).join(" ");
|
|
145
147
|
}
|
|
146
148
|
populates.push(populate);
|
|
147
149
|
};
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -38,7 +38,9 @@ abstract class SearchFlow {
|
|
|
38
38
|
|
|
39
39
|
let projection: { [key: string]: number } = {}
|
|
40
40
|
for (var field of this.select) {
|
|
41
|
-
|
|
41
|
+
if (field.indexOf(".")) {
|
|
42
|
+
projection[field] = 1
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
return projection
|
|
@@ -72,7 +74,7 @@ abstract class SearchFlow {
|
|
|
72
74
|
let populate = this.buildPath(first, nested)
|
|
73
75
|
if (Array.isArray(this.select)) {
|
|
74
76
|
let selects = (this.select as []).filter((sel: string) => sel.startsWith(`${first}.`))
|
|
75
|
-
populate.select = selects.map((sel: string) => sel.split(".")[
|
|
77
|
+
populate.select = selects.map((sel: string) => sel.split(".")[1]).join(" ")
|
|
76
78
|
}
|
|
77
79
|
populates.push(populate)
|
|
78
80
|
}
|