Open natarajgandhi opened 7 years ago
DB({column:{"!is":["val1","val2","val3"]}})
There seems to be a bug here.
let DB = taffy( [ { myCol : 'val1' } ] );
assert(DB().count(), 1); // only 1 record
assert(DB( { myCol: { 'is': [ 'val1', 'val2' ] } }).count(), 1); // myCol IN ['val1', 'val2'] as expected
assert(DB( { myCol: { 'is': [ 'val2', 'val1' ] } }).count(), 1); // reverse order and myCol IN ['val2', 'val1'] as expected
assert(DB( { myCol: { 'is': [ 'val3', 'val2' ] } }).count(), 0); // myCol IN ['val3', 'val2'] is false as expected
assert(DB( { myCol: { '!is': ['val1', 'val2'] } }).count(), 0); // myCol NOT IN ['val1', 'val2'] seems to return nothing as expected
assert(DB( { myCol: { '!is': ['val2', 'val1'] } }).count(), 0); // fail, it returns the record.
Hi,
I am trying to write a query to filter for array of values which do not belong to a column. Basically, trying to write a "not in" a set of values condition.
Kindly advise if I can achieve the same with Taffy. Went through the documentation in http://taffydb.com/writing_queries.html, however, couldn't locate a not in condition. Kindly advise.
Thanks and Regards, Nataraj