updateMany the manyToMany relation。

System Information
  • Strapi Version: 4.25.7
  • Operating System: mac os
  • Database: pg
  • Node Version: v20.14
  • NPM Version: 10.7
  • Yarn Version: 1.22.22
await strapi.db.query("api::document.document").updateMany({
      where: {
        id: {
          $in: mov_ids,
        }
      },
      data: {
        directories: {
          connect: [new_dir_id],
          disconnect: [old_dir_id],
        },
      },
    });

Error: Update requires data.

I am trying to move documents in bulk from directory A to B. Documents and directories have many to many relationships.

By reviewing the source code, I found that the ‘processData’ function does not support ‘joinTable’, only ‘joinColumn’ and ‘morphoColumn’. The relationship between ‘updateMany’ is’ joinTable '. I want to know if this is a technical issue or a progress issue.

Is there any other way to achieve batch updates for many to many relationships?