c2-mongoose 2.1.125 → 2.1.126
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 +13 -13
- package/package.json +1 -1
- package/src/flow/SearchFlow.ts +1 -2
package/dist/flow/SearchFlow.js
CHANGED
|
@@ -155,10 +155,11 @@ var SearchFlow = /** @class */ (function () {
|
|
|
155
155
|
return new RegExp("".concat(regexExpression), 'i');
|
|
156
156
|
};
|
|
157
157
|
SearchFlow.prototype.searchNoPageable = function (model, options) {
|
|
158
|
+
var _a;
|
|
158
159
|
return __awaiter(this, void 0, void 0, function () {
|
|
159
|
-
var stagesItems, stagesMetadata, facet, _i, stagesMetadata_1, metadata, result, items,
|
|
160
|
-
return __generator(this, function (
|
|
161
|
-
switch (
|
|
160
|
+
var stagesItems, stagesMetadata, facet, _i, stagesMetadata_1, metadata, result, items, _b, _c, populate, resultAux;
|
|
161
|
+
return __generator(this, function (_d) {
|
|
162
|
+
switch (_d.label) {
|
|
162
163
|
case 0:
|
|
163
164
|
stagesItems = [{ $match: this.filters }];
|
|
164
165
|
if ((0, Utils_1.isNotEmpty)(options.unions)) {
|
|
@@ -171,8 +172,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
171
172
|
stagesItems.push.apply(stagesItems, options.pipelines);
|
|
172
173
|
}
|
|
173
174
|
stagesItems.push({ $sort: this.sort });
|
|
174
|
-
stagesItems.push({ $
|
|
175
|
-
stagesItems.push({ $limit: this.limit });
|
|
175
|
+
stagesItems.push({ $limit: (_a = this.limit) !== null && _a !== void 0 ? _a : 50 });
|
|
176
176
|
stagesMetadata = [];
|
|
177
177
|
if ((0, Utils_1.isNotEmpty)(options.metadata)) {
|
|
178
178
|
stagesMetadata.push.apply(stagesMetadata, options.metadata);
|
|
@@ -190,20 +190,20 @@ var SearchFlow = /** @class */ (function () {
|
|
|
190
190
|
},
|
|
191
191
|
]).session(options === null || options === void 0 ? void 0 : options.session)];
|
|
192
192
|
case 1:
|
|
193
|
-
result =
|
|
193
|
+
result = _d.sent();
|
|
194
194
|
items = result[0].items;
|
|
195
195
|
if (!((0, Utils_1.isNotEmpty)(this.populate) && Array.isArray(this.populate))) return [3 /*break*/, 5];
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
_b = 0, _c = this.populate;
|
|
197
|
+
_d.label = 2;
|
|
198
198
|
case 2:
|
|
199
|
-
if (!(
|
|
200
|
-
populate = _b
|
|
199
|
+
if (!(_b < _c.length)) return [3 /*break*/, 5];
|
|
200
|
+
populate = _c[_b];
|
|
201
201
|
return [4 /*yield*/, model.populate(result[0].items, populate)];
|
|
202
202
|
case 3:
|
|
203
|
-
items =
|
|
204
|
-
|
|
203
|
+
items = _d.sent();
|
|
204
|
+
_d.label = 4;
|
|
205
205
|
case 4:
|
|
206
|
-
|
|
206
|
+
_b++;
|
|
207
207
|
return [3 /*break*/, 2];
|
|
208
208
|
case 5:
|
|
209
209
|
resultAux = this.transformObject(result[0]);
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -138,8 +138,7 @@ abstract class SearchFlow {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
stagesItems.push({ $sort: this.sort })
|
|
141
|
-
stagesItems.push({ $
|
|
142
|
-
stagesItems.push({ $limit: this.limit })
|
|
141
|
+
stagesItems.push({ $limit: this.limit ?? 50 })
|
|
143
142
|
|
|
144
143
|
let stagesMetadata: any[] = []
|
|
145
144
|
if (isNotEmpty(options.metadata)) {
|