loopbackio/loopback-connector

Filtering with non existing / declared field is ignored / skipped

Open

#125 opened on May 31, 2018

View on GitHub
 (4 comments) (0 reactions) (0 assignees)JavaScript (101 forks)auto 404
bughelp wantedmajor

Repository metrics

Stars
 (35 stars)
PR merge metrics
 (PR metrics pending)

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

Contributor guide