loopbackio / loopbackio/loopback-next

inq filter for referencesMany relationships not working properly

Open
#11,169 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.