loopbackio / loopbackio/loopback-next
inq filter for referencesMany relationships not working properly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### Describe the bug
As the title says, the inq filter is not working correctly for referencesMany relations.
I have created a docker-based example to showcase this error. Here is the [repo](https://github.com/aaqilniz/lb4-issue-samples).
Once the example is up and running with `docker-compose up`, try accessing http://localhost:3000/users?filter={"where":{"companyIds":{"inq":[2]}}} would yield no results - though there is a record with the said id in the database.
### Logs
```shell
```
### Additional information
_No response_
### Reproduction
https://github.com/aaqilniz/lb4-issue-samples
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the linked reproduction with docker-compose up, then request the documented users URL with the inq filter for companyIds. Trace the LoopBack referencesMany filtering path from that request and compare it with the related database records; done means the query returns the user whose company relation contains ID 2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, typescript
- Domain
- api, backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100