c2-mongoose 2.1.67 → 2.1.69

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.
@@ -121,7 +121,7 @@ var SearchFlow = /** @class */ (function () {
121
121
  return;
122
122
  }
123
123
  if (Array.isArray(this.populate)) {
124
- return undefined;
124
+ return this.buildPopulateArray();
125
125
  }
126
126
  var propertiesArray = this.populate.toString().split(',');
127
127
  var populates = [];
@@ -141,7 +141,7 @@ var SearchFlow = /** @class */ (function () {
141
141
  var populate = this_1.buildPath(first, nested);
142
142
  if (Array.isArray(this_1.select)) {
143
143
  var selects = this_1.select.filter(function (sel) { return sel.startsWith("".concat(first, ".")); });
144
- populate.select = selects.join(" ");
144
+ populate.select = selects.map(function (sel) { return sel.split(".")[0]; }).join(" ");
145
145
  }
146
146
  populates.push(populate);
147
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.67",
3
+ "version": "2.1.69",
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",
@@ -50,7 +50,7 @@ abstract class SearchFlow {
50
50
  }
51
51
 
52
52
  if (Array.isArray(this.populate)) {
53
- return undefined
53
+ return this.buildPopulateArray()
54
54
  }
55
55
 
56
56
  var propertiesArray = (this.populate as string).toString().split(',')
@@ -72,7 +72,7 @@ abstract class SearchFlow {
72
72
  let populate = this.buildPath(first, nested)
73
73
  if (Array.isArray(this.select)) {
74
74
  let selects = (this.select as []).filter((sel: string) => sel.startsWith(`${first}.`))
75
- populate.select = selects.join(" ")
75
+ populate.select = selects.map((sel: string) => sel.split(".")[0]).join(" ")
76
76
  }
77
77
  populates.push(populate)
78
78
  }