Skip to content

[V4] QueryEngine - deleteMany not working when filter by nested entity. #11998

@c7ming

Description

@c7ming

Bug report

Describe the bug

When trying to deleteMany by the nested entity filtering, An error occurs.

Steps to reproduce the behavior

  1. Have eneties A & B.
  2. Add relation between A & B, and B has many A.
  3. Execute codes

Expected behavior

All B filtered A will be deleted.

Screenshots

image

Code snippets

await strapi.query(A).deleteMany({ where: { B: { id: { $eq: params.id }, } } })

System

  • Node.js version: V14
  • NPM version: 7.22.0
  • Strapi version: 4.0.1
  • Database: MySql
  • Operating system: MacOs Monterey

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solvesource: core:databaseSource is core/database packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    Status

    Fixed/Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions