Skip to content

startsWith and endsWith operators are reversed #10743

@gabegorelick

Description

@gabegorelick

What are you doing?

#9999 introduced the startsWith and endsWith operators, but they seem to be reversed:

image

What do you expect to happen?

[Op.startsWith]: 'hat' should be defined as hat%, i.e. the string begins with hat and then has anything afterwards.

[Op.endsWith]: 'hat' should be defined as %hat, i.e. the string begins with anything but ends with hat.

What is actually happening?

startsWith and endWith are the reverse of what I expect. The unit tests for this feature exhibit the same behavior.

Dialect: any
Dialect version: any
Database version: any
Sequelize version: master
Tested with latest release: yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasedtype: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions