c2-mongoose 2.1.219 → 2.1.221

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.
@@ -16,7 +16,7 @@ declare class SearcherFlow<D> {
16
16
  private page;
17
17
  private limit;
18
18
  private pageable;
19
- private selection;
19
+ private select;
20
20
  private populate;
21
21
  private filters;
22
22
  constructor(repository: mongoose.Model<any>, search?: SearchFlow);
@@ -63,7 +63,7 @@ var SearcherFlow = /** @class */ (function () {
63
63
  this.page = 1;
64
64
  this.limit = 50;
65
65
  this.pageable = true;
66
- this.selection = [""];
66
+ this.select = [""];
67
67
  this.populate = [""];
68
68
  this.filters = undefined;
69
69
  this.model = repository;
@@ -95,8 +95,8 @@ var SearcherFlow = /** @class */ (function () {
95
95
  stagesItems.push.apply(stagesItems, options.unions);
96
96
  }
97
97
  stagesItems.push({ $match: this.filters });
98
- if ((0, Utils_1.isNotEmpty)(this.projection)) {
99
- stagesItems.push({ $project: BuildSelectSingleFlowItem_1.default.build(model, this.selection) });
98
+ if ((0, Utils_1.isNotEmpty)(this.select)) {
99
+ stagesItems.push({ $project: BuildSelectSingleFlowItem_1.default.build(model, this.select) });
100
100
  }
101
101
  // stagesItems.push({ $sort: this.sort })
102
102
  if (this.pageable === true) {
@@ -154,7 +154,7 @@ var SearcherFlow = /** @class */ (function () {
154
154
  result = _b.sent();
155
155
  if (!(0, Utils_1.isNotEmpty)(this.populate)) return [3 /*break*/, 3];
156
156
  _a = result[0];
157
- return [4 /*yield*/, model.populate(result[0].items, BuildPopulateSingleFlowItem_1.default.buildPopulate(model, this.populate, this.selection))];
157
+ return [4 /*yield*/, model.populate(result[0].items, BuildPopulateSingleFlowItem_1.default.buildPopulate(model, this.populate, this.select))];
158
158
  case 2:
159
159
  _a.items = _b.sent();
160
160
  _b.label = 3;
@@ -191,6 +191,7 @@ var SearcherFlow = /** @class */ (function () {
191
191
  if ((0, Utils_1.isNotEmpty)(value)) {
192
192
  var condition = {};
193
193
  if ([
194
+ 'filters',
194
195
  'onlyMetadata',
195
196
  'projection',
196
197
  'pageable',
@@ -201,7 +202,7 @@ var SearcherFlow = /** @class */ (function () {
201
202
  'page',
202
203
  'limit',
203
204
  'model',
204
- 'selection',
205
+ 'select',
205
206
  'searchText',
206
207
  'sort',
207
208
  'isPageable',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.219",
3
+ "version": "2.1.221",
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",
@@ -24,7 +24,7 @@ class SearcherFlow<D> {
24
24
  private limit: number = 50
25
25
  private pageable: boolean = true
26
26
 
27
- private selection: string[] = [""]
27
+ private select: string[] = [""]
28
28
  private populate: string[] = [""]
29
29
  private filters: any = undefined
30
30
 
@@ -61,8 +61,8 @@ class SearcherFlow<D> {
61
61
 
62
62
  stagesItems.push({ $match: this.filters })
63
63
 
64
- if (isNotEmpty(this.projection)) {
65
- stagesItems.push({ $project: BuildSelectSingleFlowItem.build(model, this.selection) })
64
+ if (isNotEmpty(this.select)) {
65
+ stagesItems.push({ $project: BuildSelectSingleFlowItem.build(model, this.select) })
66
66
  }
67
67
 
68
68
  // stagesItems.push({ $sort: this.sort })
@@ -127,7 +127,7 @@ class SearcherFlow<D> {
127
127
 
128
128
 
129
129
  if (isNotEmpty(this.populate)) {
130
- result[0].items = await model.populate(result[0].items, BuildPopulateSingleFlowItem.buildPopulate(model, this.populate, this.selection))
130
+ result[0].items = await model.populate(result[0].items, BuildPopulateSingleFlowItem.buildPopulate(model, this.populate, this.select))
131
131
  }
132
132
 
133
133
  let resultAux = this.transformObject(result[0])
@@ -165,6 +165,7 @@ class SearcherFlow<D> {
165
165
  if (isNotEmpty(value)) {
166
166
  let condition = {} as any
167
167
  if ([
168
+ 'filters',
168
169
  'onlyMetadata',
169
170
  'projection',
170
171
  'pageable',
@@ -175,7 +176,7 @@ class SearcherFlow<D> {
175
176
  'page',
176
177
  'limit',
177
178
  'model',
178
- 'selection',
179
+ 'select',
179
180
  'searchText',
180
181
  'sort',
181
182
  'isPageable',