c2-mongoose 2.1.210 → 2.1.211
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 BuildSelectSingleFlowItem = /** @class */ (function () {
|
|
|
27
27
|
};
|
|
28
28
|
BuildSelectSingleFlowItem.prototype.buildProjectionNested = function (model, projectCurrent, field, include) {
|
|
29
29
|
var _a = field.split('.'), first = _a[0], rest = _a.slice(1);
|
|
30
|
-
if ((0, Utils_1.
|
|
30
|
+
if ((0, Utils_1.isNotEmpty)(first) && (0, Utils_1.isNotEmpty)(rest)) {
|
|
31
31
|
var campoInfo = model.schema.path(first);
|
|
32
32
|
// Verifique se o tipo do campo é mongoose.Types.ObjectId
|
|
33
33
|
if (campoInfo.instance === "ObjectID") {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import mongoose from "mongoose"
|
|
2
|
-
import {
|
|
2
|
+
import { isNotEmpty } from "../../utils/Utils"
|
|
3
3
|
|
|
4
4
|
class BuildSelectSingleFlowItem {
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ class BuildSelectSingleFlowItem {
|
|
|
21
21
|
buildProjectionNested(model: mongoose.Model<any>, projectCurrent: any, field: string, include: boolean) {
|
|
22
22
|
let [first, ...rest] = field.split('.')
|
|
23
23
|
|
|
24
|
-
if (
|
|
24
|
+
if (isNotEmpty(first) && isNotEmpty(rest)){
|
|
25
25
|
|
|
26
26
|
const campoInfo = model.schema.path(first);
|
|
27
27
|
|