c2-mongoose 2.1.362 → 2.1.363

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.
@@ -9,6 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ var lodash_1 = require("lodash");
12
13
  var OneToManyFlowItem = /** @class */ (function () {
13
14
  function OneToManyFlowItem() {
14
15
  }
@@ -21,7 +22,7 @@ var OneToManyFlowItem = /** @class */ (function () {
21
22
  from: foreing.collectionChild,
22
23
  localField: "_id",
23
24
  foreignField: foreing.parentFieldOnChild,
24
- as: foreing.collectionChild
25
+ as: (0, lodash_1.camelCase)(foreing.collectionChild)
25
26
  }
26
27
  },
27
28
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.362",
3
+ "version": "2.1.363",
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",
@@ -30,11 +30,13 @@
30
30
  "dependencies": {
31
31
  "dotenv": "^16.0.3",
32
32
  "express-http-context": "^1.2.4",
33
+ "lodash": "^4.17.21",
33
34
  "moment": "^2.29.4",
34
35
  "moment-timezone": "^0.5.43",
35
36
  "mongoose": "8.16.1"
36
37
  },
37
38
  "devDependencies": {
39
+ "@types/lodash": "^4.17.20",
38
40
  "typescript": "^4.9.5"
39
41
  }
40
42
  }
@@ -1,5 +1,4 @@
1
- import mongoose from "mongoose";
2
-
1
+ import { camelCase } from "lodash"
3
2
  export interface IForeingData {
4
3
  collectionChild: string;
5
4
  parentFieldOnChild: string;
@@ -15,7 +14,7 @@ class OneToManyFlowItem {
15
14
  from: foreing.collectionChild, // The collection where user data is stored
16
15
  localField: "_id",
17
16
  foreignField: foreing.parentFieldOnChild,
18
- as: foreing.collectionChild
17
+ as: camelCase(foreing.collectionChild)
19
18
  }
20
19
  },
21
20
  ]