Skip to content

How do I put sequelize.literal to .get() or .patch() call query? #344

@1valdis

Description

@1valdis

I want to put a sequelize.literal query under Op.and symbol before get and patch method to attach an EXISTS query. But at the same time, seems like because of the Object.assign there (duplicated below), the id is lost from the query and only my sequelize.literal remains.

where: Object.assign({
        [this.Op.and]: { [this.id]: id }
      }, where)

In patch method it works vice-versa: my [Op.and] gets replaced with id query. This isn't right because I want to filter what is getting patched.

Is there any way to accomplish including sequelize.literal in a way that works across methods without too much mess (or in case of patch, accomplish that at all)?

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