c2-mongoose 2.1.374 → 2.1.375
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.
|
@@ -33,16 +33,14 @@ var LookupManyToOneFlowItem = /** @class */ (function () {
|
|
|
33
33
|
var nextRefModel = global.connectionMongoose.model(nextModelName);
|
|
34
34
|
var collectionName = nextRefModel.collection.name;
|
|
35
35
|
if (!__spreadArray(__spreadArray([], previousClauses, true), populateClauseLookup, true).some(function (populateClause) { var _a; return ((_a = populateClause === null || populateClause === void 0 ? void 0 : populateClause.$lookup) === null || _a === void 0 ? void 0 : _a.localField) === nextField; })) {
|
|
36
|
-
populateClauseLookup.push(
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
]);
|
|
36
|
+
populateClauseLookup.push({
|
|
37
|
+
$lookup: {
|
|
38
|
+
from: collectionName,
|
|
39
|
+
localField: nextField,
|
|
40
|
+
foreignField: "_id",
|
|
41
|
+
as: nextField
|
|
42
|
+
}
|
|
43
|
+
});
|
|
46
44
|
if (nextType !== 'Array') {
|
|
47
45
|
populateClauseLookup.push({
|
|
48
46
|
$addFields: (_a = {},
|
package/package.json
CHANGED
|
@@ -68,7 +68,9 @@ class LookupArrayFlowItem {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
populateClauseLookup = [
|
|
71
|
+
populateClauseLookup = [
|
|
72
|
+
...populateClauseLookup,
|
|
73
|
+
...LookupManyToOneFlowItem.execute(othersFields, [...populateClauses, ...populateClauseLookup], currentModel)]
|
|
72
74
|
|
|
73
75
|
return [...populateClauseLookup]
|
|
74
76
|
} catch (error: any) {
|
|
@@ -24,7 +24,7 @@ class LookupManyToOneFlowItem {
|
|
|
24
24
|
let collectionName = nextRefModel.collection.name;
|
|
25
25
|
|
|
26
26
|
if (![...previousClauses, ...populateClauseLookup].some((populateClause: any) => populateClause?.$lookup?.localField === nextField)) {
|
|
27
|
-
populateClauseLookup.push(
|
|
27
|
+
populateClauseLookup.push(
|
|
28
28
|
{
|
|
29
29
|
$lookup: {
|
|
30
30
|
from: collectionName, // The collection where user data is stored
|
|
@@ -33,7 +33,7 @@ class LookupManyToOneFlowItem {
|
|
|
33
33
|
as: nextField
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
)
|
|
37
37
|
if (nextType !== 'Array') {
|
|
38
38
|
populateClauseLookup.push(
|
|
39
39
|
{
|