loopbackio / loopbackio/loopback-next
[@loopback/sequelize] Attempting to use `options` in a `where` filter leads to "There is no equivalent operator" exception
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### Describe the bug
This section of the code throws an exception if the "where" filter includes an "options" key: https://github.com/loopbackio/loopback-next/blob/96b9a56788937f081e61f1d48dc080c7233d394c/extensions/sequelize/src/sequelize/sequelize.repository.base.ts#L604
Example filter that will throw an exception:
```
where: {
name: {
like: '%abcdefg%',
options: 'i'
}
}
```
References:
- https://loopback.io/doc/en/lb4/Where-filter.html#operators
### Logs
_No response_
### Additional information
_No response_
### Reproduction
N/A
Contributor guide
Research direction
Start at extensions/sequelize/src/sequelize/sequelize.repository.base.ts around line 604 and compare the failing where filter with the documented operators. Determine the expected handling of the options key, then verify that the example filter no longer raises the “There is no equivalent operator” exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100