c2-mongoose 2.1.254 → 2.1.255

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.
@@ -27,7 +27,7 @@ var BuildPopulateSingleFlowItem = /** @class */ (function () {
27
27
  var populateLocal = this_1.buildPath(first, nested, existing2);
28
28
  //EXISTE UMA LIMITACAO DE SELECT A PARTIR DO 3 NIVEL DENTRO DOS CAMPO POPULATE, MELHORAR O CODIGO ABAIXO PARA PERCORRER MAIS NIVEIS
29
29
  if (Array.isArray(selectsStr)) {
30
- var allSelectOfPopulate = selectsStr.filter(function (sel) { return sel.startsWith("".concat(first, ".").concat(populateLocal.path)); });
30
+ var allSelectOfPopulate = selectsStr.filter(function (sel) { return sel.startsWith("".concat(populateLocal.path, ".")); });
31
31
  var firstLevelSelect = allSelectOfPopulate.map(function (sel) { return sel.split(".")[1].trim(); });
32
32
  var select = Array.from(new Set(firstLevelSelect)).join(" ").trim();
33
33
  if ((0, Utils_1.isNotEmpty)(select)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.254",
3
+ "version": "2.1.255",
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",
@@ -20,7 +20,7 @@ class BuildPopulateSingleFlowItem {
20
20
 
21
21
  //EXISTE UMA LIMITACAO DE SELECT A PARTIR DO 3 NIVEL DENTRO DOS CAMPO POPULATE, MELHORAR O CODIGO ABAIXO PARA PERCORRER MAIS NIVEIS
22
22
  if (Array.isArray(selectsStr)) {
23
- let allSelectOfPopulate = (selectsStr as []).filter((sel: string) => sel.startsWith(`${first}.${populateLocal.path}`))
23
+ let allSelectOfPopulate = (selectsStr as []).filter((sel: string) => sel.startsWith(`${populateLocal.path}.`))
24
24
  let firstLevelSelect = allSelectOfPopulate.map((sel: string) => sel.split(".")[1].trim())
25
25
  let select = Array.from(new Set(firstLevelSelect)).join(" ").trim()
26
26
  if (isNotEmpty(select)) {