c2-mongoose 2.1.93 → 2.1.94

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.
@@ -197,7 +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
+ (0, Utils_1.isNotEmpty)(options.unions) ? options.unions : undefined,
201
201
  this.projection ? { $project: this.projection } : { $addFields: {} }
202
202
  ], options.pipelines, true), [
203
203
  { $sort: this.sort },
@@ -210,7 +210,7 @@ var SearchFlow = /** @class */ (function () {
210
210
  items: stagesItems,
211
211
  paging: [
212
212
  { $match: this.filters },
213
- (0, Utils_1.isNotEmpty)(options.unions) ? __spreadArray([], options.unions, true) : undefined,
213
+ (0, Utils_1.isNotEmpty)(options.unions) ? options.unions : undefined,
214
214
  { $count: "total" },
215
215
  {
216
216
  $addFields: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.93",
3
+ "version": "2.1.94",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -120,7 +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
+ isNotEmpty(options.unions) ? options.unions : undefined,
124
124
  this.projection ? { $project: this.projection } : { $addFields: {} },
125
125
  ...options.pipelines,
126
126
  { $sort: this.sort },
@@ -135,7 +135,7 @@ abstract class SearchFlow {
135
135
  items: stagesItems as any,
136
136
  paging: [
137
137
  { $match: this.filters },
138
- isNotEmpty(options.unions) ? [...options.unions] as any : undefined,
138
+ isNotEmpty(options.unions) ? options.unions as any : undefined,
139
139
  { $count: "total" },
140
140
  {
141
141
  $addFields: