c2-mongoose 2.1.233 → 2.1.235

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.
@@ -63,8 +63,8 @@ var SearcherFlow = /** @class */ (function () {
63
63
  this.page = 1;
64
64
  this.limit = 50;
65
65
  this.pageable = true;
66
- this.select = [""];
67
- this.populate = [""];
66
+ this.select = [];
67
+ this.populate = [];
68
68
  this.filters = undefined;
69
69
  this.model = repository;
70
70
  }
@@ -22,6 +22,9 @@ var BuildSelectSingleFlowItem = /** @class */ (function () {
22
22
  var projection = {};
23
23
  for (var _i = 0, selects_1 = selects; _i < selects_1.length; _i++) {
24
24
  var field = selects_1[_i];
25
+ if ((0, Utils_1.isEmpty)(field)) {
26
+ continue;
27
+ }
25
28
  var include = field.startsWith("-") ? false : true;
26
29
  field = field.replace("-", "");
27
30
  projection = __assign(__assign({}, projection), this.buildProjectionNested(model, projection, field, include));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.233",
3
+ "version": "2.1.235",
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",
@@ -23,8 +23,8 @@ class SearcherFlow<D> {
23
23
  private limit: number = 50
24
24
  private pageable: boolean = true
25
25
 
26
- private select: string[] = [""]
27
- private populate: string[] = [""]
26
+ private select: string[] = []
27
+ private populate: string[] = []
28
28
  private filters: any = undefined
29
29
 
30
30
  constructor(repository: mongoose.Model<any>) {
@@ -11,6 +11,9 @@ class BuildSelectSingleFlowItem {
11
11
 
12
12
  let projection: any = {}
13
13
  for (var field of selects) {
14
+ if (isEmpty(field)) {
15
+ continue
16
+ }
14
17
  let include = field.startsWith("-") ? false : true
15
18
  field = field.replace("-", "")
16
19
  projection = {