redis-om-node icon indicating copy to clipboard operation
redis-om-node copied to clipboard

Add in (eq for multiple values)

Open edde746 opened this issue 3 years ago • 4 comments

Check a field against an array of values, similar to SQLs IN.

edde746 avatar Feb 14 '22 15:02 edde746

Could also make this variadic so you can say .where('foo').eq('alfa', 'bravo', 'charlie') as well as .where('foo').eq(['alfa', 'bravo', 'charlie']).

guyroyse avatar Feb 28 '22 16:02 guyroyse

It could be great if we could exclude too: .where('foo').not.eq('alfa', 'bravo', 'charlie') or .where('foo').not.eq(['alfa', 'bravo', 'charlie']).

Is there a way to do it through searchRaw in the meantime?

loicbisiere avatar Jan 21 '23 02:01 loicbisiere

I think the way I wrote search, the negation will just work. But I'll confirm when I work on this feature. For a call to .searchRaw this should be perfectly possible.

@foo:{ alfa | bravo | charlie }: alfa OR bravo OR charlie @foo:{ alfa } @foo:{ bravo } @foo:{ charlie }: alfa AND bravo AND charlie -@foo:{ alfa } -@foo:{ bravo } -@foo:{ charlie }: NOT alfa AND NOT bravo AND NOT charlie

guyroyse avatar Jan 23 '23 18:01 guyroyse