c2-mongoose 2.1.91 → 2.1.93
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
|
@@ -197,6 +197,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
197
197
|
case 0:
|
|
198
198
|
stagesItems = __spreadArray(__spreadArray([
|
|
199
199
|
{ $match: this.filters },
|
|
200
|
+
(0, Utils_1.isNotEmpty)(options.unions) ? __spreadArray([], options.unions, true) : undefined,
|
|
200
201
|
this.projection ? { $project: this.projection } : { $addFields: {} }
|
|
201
202
|
], options.pipelines, true), [
|
|
202
203
|
{ $sort: this.sort },
|
|
@@ -209,6 +210,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
209
210
|
items: stagesItems,
|
|
210
211
|
paging: [
|
|
211
212
|
{ $match: this.filters },
|
|
213
|
+
(0, Utils_1.isNotEmpty)(options.unions) ? __spreadArray([], options.unions, true) : undefined,
|
|
212
214
|
{ $count: "total" },
|
|
213
215
|
{
|
|
214
216
|
$addFields: {
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -120,6 +120,7 @@ abstract class SearchFlow {
|
|
|
120
120
|
async searchPageable(model: mongoose.Model<any>, options: SearchOptions) {
|
|
121
121
|
let stagesItems = [
|
|
122
122
|
{ $match: this.filters },
|
|
123
|
+
isNotEmpty(options.unions) ? [...options.unions] : undefined,
|
|
123
124
|
this.projection ? { $project: this.projection } : { $addFields: {} },
|
|
124
125
|
...options.pipelines,
|
|
125
126
|
{ $sort: this.sort },
|
|
@@ -134,6 +135,7 @@ abstract class SearchFlow {
|
|
|
134
135
|
items: stagesItems as any,
|
|
135
136
|
paging: [
|
|
136
137
|
{ $match: this.filters },
|
|
138
|
+
isNotEmpty(options.unions) ? [...options.unions] as any : undefined,
|
|
137
139
|
{ $count: "total" },
|
|
138
140
|
{
|
|
139
141
|
$addFields:
|