Filtering with non existing / declared field is ignored

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, sqlite
Domain
database

Research direction

Start by reproducing the issue with the SQLite3 connector using Model.find({where: { nonexistingfield: 'test' } }) after inserting 10 rows. Compare the result with the stated Memory connector behavior and determine whether an unknown field should return zero rows or an error. Done means the SQLite3 connector no longer returns all rows for this filter, with coverage for the reported query.

Written by the indexing model from the issue text.

Description

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
Expected result

Return 0 (Memory connector return 0)
Maybe this should return an error ?

Actual result (if bug)

Return all the documents/rows

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

Tested with master of loopback-connector-sqlite3

Dominant language
JavaScript
Stars
13
Forks
21
PR merge metrics
No merged PRs in 30d

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.

More from loopbackio/loopback-connector-sqlite3

All issues in loopbackio/loopback-connector-sqlite3

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.