c2-mongoose 2.1.422 → 2.1.423

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.
@@ -30,7 +30,7 @@ var PopulateFlowItem = /** @class */ (function () {
30
30
  if (!fieldDefinition)
31
31
  return;
32
32
  var typeFirst = fieldDefinition.instance;
33
- if (typeFirst === 'Array') {
33
+ if (typeFirst === 'Array' && (rest === null || rest === void 0 ? void 0 : rest.length)) {
34
34
  populateClauses = __spreadArray(__spreadArray([], populateClauses, true), LookupArrayFlowItem_1.default.execute(first, rest, populateClauses, modelRoot), true);
35
35
  return;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.422",
3
+ "version": "2.1.423",
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",
@@ -19,7 +19,7 @@ class PopulateFlowItem {
19
19
 
20
20
  let typeFirst = fieldDefinition.instance
21
21
 
22
- if (typeFirst === 'Array') {
22
+ if (typeFirst === 'Array' && rest?.length) {
23
23
  populateClauses = [...populateClauses, ...LookupArrayFlowItem.execute(first, rest, populateClauses, modelRoot)]
24
24
  return
25
25
  }