Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@loopback/sequelize] Attempting to use options in a where filter leads to "There is no equivalent operator" exception #9690

Open
KalleV opened this issue Jun 24, 2023 · 2 comments

Comments

@KalleV
Copy link
Contributor

KalleV commented Jun 24, 2023

Describe the bug

This section of the code throws an exception if the "where" filter includes an "options" key:

const sequelizeOperator = this.getSequelizeOperator(

Example filter that will throw an exception:

where: {
   name: {
     like: '%abcdefg%',
     options: 'i'
   }
}

References:

Logs

No response

Additional information

No response

Reproduction

N/A

@KalleV KalleV added the bug label Jun 24, 2023
@shubhamp-sf
Copy link
Contributor

@loopback/sequelize is meant to be used with SQL dialects, this option being only supported by LoopBack in its memory and MongoDB connectors is not expected to work correctly.
Screenshot 2023-06-25 at 12 26 08 PM

Please use ilike or regexp operator instead depending on your needs.

@KalleV
Copy link
Contributor Author

KalleV commented Jun 30, 2023

@shubhamp-sf That’s true but the existing connector doesn’t throw an exception even if it is unused by the underlying MySQL connector. I was thinking for backwards compatibility / migration purposes it might be helpful if it was a no-op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants