Skip to content

[Bug]: Query Engine update method only accept id field when setting relation #2770

@Dream4ever

Description

@Dream4ever

Link to the documentation page or resource

https://docs.strapi.io/cms/api/query-engine/single-operations#update

Describe the bug

When setting relation usign strapi.db.query().update(), the connect fields only accept id array not documentId array, but the document didn't mention this.

If documentId array is passed in, Strapi will report below error.
Expected a valid Number, got bd0xyhsdd9n86on8zkpfd3uh.

Additional context

No response

Suggested improvements or fixes

Update document to notify id other than documentId should be passed in when setting relation.

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions