@mikro-orm/core 6.3.4-dev.2 → 6.3.4-dev.3

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.
@@ -91,9 +91,9 @@ class EntityLoader {
91
91
  }
92
92
  }
93
93
  expandDotPaths(normalized, meta) {
94
- normalized.forEach(p => {
94
+ for (const p of normalized) {
95
95
  if (!p.field.includes('.')) {
96
- return;
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]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.3.4-dev.2",
3
+ "version": "6.3.4-dev.3",
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.2",
67
+ "mikro-orm": "6.3.4-dev.3",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }