@mikro-orm/core 6.3.4-dev.2 → 6.3.4-dev.4
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.
package/entity/EntityLoader.js
CHANGED
|
@@ -91,9 +91,9 @@ class EntityLoader {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
expandDotPaths(normalized, meta) {
|
|
94
|
-
|
|
94
|
+
for (const p of normalized) {
|
|
95
95
|
if (!p.field.includes('.')) {
|
|
96
|
-
|
|
96
|
+
continue;
|
|
97
97
|
}
|
|
98
98
|
const [f, ...parts] = p.field.split('.');
|
|
99
99
|
p.field = f;
|
|
@@ -105,10 +105,18 @@ class EntityLoader {
|
|
|
105
105
|
.filter(prop => prop.lazy || prop.kind !== enums_1.ReferenceKind.SCALAR)
|
|
106
106
|
.forEach(prop => p.children.push({ field: prop.name, strategy: p.strategy }));
|
|
107
107
|
}
|
|
108
|
+
else if (prop.kind === enums_1.ReferenceKind.EMBEDDED) {
|
|
109
|
+
normalized.push({
|
|
110
|
+
...p,
|
|
111
|
+
field: Object.values(prop.embeddedProps).find(c => c.embedded[1] === parts[0])?.name,
|
|
112
|
+
children: [],
|
|
113
|
+
});
|
|
114
|
+
p.children.push(this.expandNestedPopulate(prop.type, parts, p.strategy, p.all));
|
|
115
|
+
}
|
|
108
116
|
else {
|
|
109
117
|
p.children.push(this.expandNestedPopulate(prop.type, parts, p.strategy, p.all));
|
|
110
118
|
}
|
|
111
|
-
}
|
|
119
|
+
}
|
|
112
120
|
}
|
|
113
121
|
/**
|
|
114
122
|
* Merge multiple populates for the same entity with different children. Also skips `*` fields, those can come from
|
|
@@ -404,6 +412,9 @@ class EntityLoader {
|
|
|
404
412
|
const where = options.where;
|
|
405
413
|
const subCond = Utils_1.Utils.isPlainObject(where[prop.name]) ? where[prop.name] : {};
|
|
406
414
|
const meta2 = this.metadata.find(prop.type);
|
|
415
|
+
if (!meta2) {
|
|
416
|
+
return {};
|
|
417
|
+
}
|
|
407
418
|
const pk = Utils_1.Utils.getPrimaryKeyHash(meta2.primaryKeys);
|
|
408
419
|
['$and', '$or'].forEach(op => {
|
|
409
420
|
if (where[op]) {
|
|
@@ -896,10 +896,13 @@ class MetadataDiscovery {
|
|
|
896
896
|
prop.hydrate = false;
|
|
897
897
|
return;
|
|
898
898
|
}
|
|
899
|
-
|
|
900
|
-
prop.
|
|
901
|
-
|
|
902
|
-
|
|
899
|
+
const newProp = Utils_1.Utils.copy(prop, false);
|
|
900
|
+
if (prop.enum && prop.items && meta.root.properties[prop.name]?.items) {
|
|
901
|
+
newProp.items = Utils_1.Utils.unique([...meta.root.properties[prop.name].items, ...prop.items]);
|
|
902
|
+
}
|
|
903
|
+
newProp.nullable = true;
|
|
904
|
+
newProp.inherited = true;
|
|
905
|
+
meta.root.addProperty(newProp);
|
|
903
906
|
});
|
|
904
907
|
meta.collection = meta.root.collection;
|
|
905
908
|
meta.root.indexes = Utils_1.Utils.unique([...meta.root.indexes, ...meta.indexes]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.3.4-dev.
|
|
3
|
+
"version": "6.3.4-dev.4",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.3.4-dev.
|
|
67
|
+
"mikro-orm": "6.3.4-dev.4",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|