@mikro-orm/mongodb 7.3.0-dev.3 → 7.3.0-dev.5

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.
Files changed (2) hide show
  1. package/MongoDriver.js +6 -0
  2. package/package.json +2 -2
package/MongoDriver.js CHANGED
@@ -535,6 +535,12 @@ export class MongoDriver extends DatabaseDriver {
535
535
  }
536
536
  }
537
537
  ret.unshift(...meta.primaryKeys.filter(pk => !fields.includes(pk)));
538
+ // `targetKey` values identify the entity like its PK, references resolve it by them
539
+ for (const key of meta.root.targetKeys ?? []) {
540
+ if (meta.properties[key] && !fields.includes(key)) {
541
+ ret.push(meta.properties[key].fieldNames[0]);
542
+ }
543
+ }
538
544
  }
539
545
  else if (!Utils.isEmpty(exclude) || lazyProps.some(p => !p.formula)) {
540
546
  const props = meta.props.filter(prop => this.platform.shouldHaveColumn(prop, populate, exclude));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mongodb",
3
- "version": "7.3.0-dev.3",
3
+ "version": "7.3.0-dev.5",
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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.3.0-dev.3"
56
+ "@mikro-orm/core": "7.3.0-dev.5"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"