@mikro-orm/core 7.2.11-dev.1 → 7.2.11-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.
@@ -358,7 +358,11 @@ export class EntityLoader {
358
358
  // When targetKey is set, use it for FK lookup instead of the PK
359
359
  let fk = prop.targetKey ?? Utils.getPrimaryKeyHash(meta.primaryKeys);
360
360
  let schema = options.schema;
361
- const partial = !Utils.isEmpty(prop.where) || !Utils.isEmpty(options.where) || !Utils.isEmpty(options.populateFilter);
361
+ const childFilter = options.populateFilter ? await this.extractChildPopulateFilter(options, prop) : undefined;
362
+ // conditions on the populated entity itself have no sink in the child query (the joined strategy puts
363
+ // them on the join), only the nested relation ones can be forwarded as its own `populateFilter`
364
+ const [ownFilter, nestedFilter] = this.splitPopulateFilter(childFilter, meta);
365
+ const partial = !Utils.isEmpty(prop.where) || !Utils.isEmpty(options.where) || !!ownFilter;
362
366
  let polymorphicOwnerProp;
363
367
  const ownerProp = prop.kind === ReferenceKind.ONE_TO_MANY || (prop.kind === ReferenceKind.MANY_TO_MANY && !prop.owner)
364
368
  ? meta.properties[prop.mappedBy]
@@ -418,10 +422,6 @@ export class EntityLoader {
418
422
  if (!Utils.isEmpty(prop.where) || Raw.hasObjectFragments(prop.where)) {
419
423
  where = { $and: [where, prop.where] };
420
424
  }
421
- const childFilter = options.populateFilter ? await this.extractChildPopulateFilter(options, prop) : undefined;
422
- // conditions on the populated entity itself have no sink in the child query (the joined strategy puts
423
- // them on the join), only the nested relation ones can be forwarded as its own `populateFilter`
424
- const [ownFilter, nestedFilter] = this.splitPopulateFilter(childFilter, meta);
425
425
  if (ownFilter) {
426
426
  where = { $and: [where, ownFilter] };
427
427
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.2.11-dev.1",
3
+ "version": "7.2.11-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
  "keywords": [
6
6
  "data-mapper",
package/utils/Utils.js CHANGED
@@ -153,7 +153,7 @@ export function parseJsonSafe(value) {
153
153
  /** Collection of general-purpose utility methods used throughout the ORM. */
154
154
  export class Utils {
155
155
  static PK_SEPARATOR = '~~~';
156
- static #ORM_VERSION = '7.2.11-dev.1';
156
+ static #ORM_VERSION = '7.2.11-dev.3';
157
157
  /** Default session variable name backing an RLS filter argument (`current_setting('mikro.<filter>.<arg>')`). */
158
158
  static getRlsSettingName(filterName, argName) {
159
159
  return `mikro.${filterName}.${argName}`;