1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

fix TS.QUERYINDEX with multiple filters (#1996)

* fix TS.QUERYINDEX with multiple filters

* Update QUERYINDEX.spec.ts

* Update QUERYINDEX.spec.ts

* Update QUERYINDEX.spec.ts

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
This commit is contained in:
JamesGDiaz
2022-02-21 17:59:21 -06:00
committed by GitHub
parent c03ab8803d
commit 6d6ec7e3e9
2 changed files with 25 additions and 14 deletions

View File

@@ -3,21 +3,28 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './QUERYINDEX';
describe('QUERYINDEX', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('*'),
['TS.QUERYINDEX', '*']
);
describe('transformArguments', () => {
it('single filter', () => {
assert.deepEqual(
transformArguments('*'),
['TS.QUERYINDEX', '*']
);
});
it('multiple filters', () => {
assert.deepEqual(
transformArguments(['a=1', 'b=2']),
['TS.QUERYINDEX', 'a=1', 'b=2']
);
});
});
testUtils.testWithClient('client.ts.queryIndex', async client => {
await Promise.all([
client.ts.create('key', {
LABELS: {
label: 'value'
}
})
]);
await client.ts.create('key', {
LABELS: {
label: 'value'
}
});
assert.deepEqual(
await client.ts.queryIndex('label=value'),