Skip to content

Feature Request: startsWith, endsWith, substring operators #9935

@abettke

Description

@abettke

What are you doing?

I want to be able to perform startsWith, endsWith, and substring queries with operators so that I do not have to manually wrap the where value with the % character as is done with the like operator. This would be something similar to the query operators offered by the Django ORM.

mymodel.findAll({
  where: {
    myField: {
      [Op.startsWith]: 'abc'
    }
  }
})

What do you expect to happen?

Output the equivalent SQL

... WHERE myField LIKE 'abc%' ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureDEPRECATED: replace with the "feature" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions