c2-mongoose 2.1.400 → 2.1.401

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.
@@ -24,8 +24,7 @@ var OneToManyFlowItem = /** @class */ (function () {
24
24
  var labeled = (0, lodash_1.camelCase)(foreing.collectionChild);
25
25
  var populateClauseLookup = [];
26
26
  if (foreing.match) {
27
- populateClauseLookup[0].$lookup.
28
- populateClauseLookup.push({
27
+ populateClauseLookup.push({
29
28
  $lookup: {
30
29
  from: foreing.collectionChild,
31
30
  let: { localField: '$_id' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.400",
3
+ "version": "2.1.401",
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",
@@ -1,6 +1,5 @@
1
1
  import { camelCase } from "lodash";
2
2
  import LookupArrayFlowItem from "./LookupArrayFlowItem";
3
- import MatchFlowItem from "./MatchFlowItem";
4
3
  export interface IForeingData {
5
4
  collectionChild: string;
6
5
  parentFieldOnChild: string;
@@ -16,22 +15,21 @@ class OneToManyFlowItem {
16
15
  const populateClauseLookup: any[] = []
17
16
 
18
17
  if (foreing.match) {
19
- populateClauseLookup[0].$lookup.
20
- populateClauseLookup.push({
21
- $lookup: {
22
- from: foreing.collectionChild, // The collection where user data is stored
23
- let: { localField: '$_id' },
24
- localField: "_id",
25
- foreignField: foreing.parentFieldOnChild,
26
- as: labeled,
27
- pipeline: [
28
- {
29
- $match:
30
- foreing.match
31
- },
32
- ]
33
- }
34
- })
18
+ populateClauseLookup.push({
19
+ $lookup: {
20
+ from: foreing.collectionChild, // The collection where user data is stored
21
+ let: { localField: '$_id' },
22
+ localField: "_id",
23
+ foreignField: foreing.parentFieldOnChild,
24
+ as: labeled,
25
+ pipeline: [
26
+ {
27
+ $match:
28
+ foreing.match
29
+ },
30
+ ]
31
+ }
32
+ })
35
33
  } else {
36
34
  populateClauseLookup.push({
37
35
  $lookup: {