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

Filtering with non existing / declared field is ignored / skipped #125

Open
1 of 2 tasks
HugoPoi opened this issue May 31, 2018 · 4 comments
Open
1 of 2 tasks

Filtering with non existing / declared field is ignored / skipped #125

HugoPoi opened this issue May 31, 2018 · 4 comments

Comments

@HugoPoi
Copy link

HugoPoi commented May 31, 2018

Bug or feature request

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

  1. Insert 10 rows in a model/table
  2. Model.find({where: { nonexistingfield: 'test' } })
  3. Return 10 rows

https://github.com/strongloop/loopback-connector/blob/97d2aea8686a2c66070696a73d23be0a76d14b97/lib/sql.js#L1096-L1100

Expected result

Return 0 (Memory connector return 0 and MongoDB Connector too)
In case of SQL this should throw an error ?

Actual result (if bug)

Return all the documents/rows

Additional information (Node.js version, LoopBack version, etc)

Only affect SQL connectors using lib/sql.js

@stale
Copy link

stale bot commented Sep 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2019
@stale
Copy link

stale bot commented Oct 1, 2019

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Oct 1, 2019
@HugoPoi
Copy link
Author

HugoPoi commented Oct 2, 2019

@jannyHou @dhmlau @emonddr Is this fix ? I think no.

@bajtos bajtos added bug and removed stale labels Oct 4, 2019
@bajtos bajtos reopened this Oct 4, 2019
@bajtos
Copy link
Member

bajtos commented Oct 4, 2019

This hasn't been fixed yet. I am afraid the fix is complicated, see the discussion in #132.

@HugoPoi would you like to look into this problem yourself and contribute a fix? Feel free to take over the code from #132.

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