google / lovefield

Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.
https://google.github.io/lovefield/
Apache License 2.0
6.82k stars 367 forks source link

Required NOT IN feature #248

Closed rkbansal closed 5 years ago

rkbansal commented 5 years ago

Hey guys can you provide something like NOT (verificationStatus IN ["entered-in-error", "refuted"]) which means take all expect where varificationStatus either entered-in-error or refuted.

It will be very helpful, thanks..

freshp86 commented 5 years ago

This is already supported. See the test at https://github.com/google/lovefield/blob/6e6cc7cae1421a8da6d5e55ffecb0cdedf6b29a6/tests/pred/not_operator_test.js#L101-L116. Your query would look as follows

const excluded = [...];
 db.select().
     from(myTable).
     where(lf.op.not(myTable.verificationStatus.in(excluded))).
     exec();