You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
MSET command added. Requires all keys to have the same JSON Path, which might fit most use cases, but is a limitation. Optionally we could make the path an array as well to support all use cases.
20 lines
631 B
TypeScript
20 lines
631 B
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './MSET';
|
|
|
|
describe('MSET', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
transformArguments(['1', '2'], '$', [{ a: 1 }, { b: 2 }]),
|
|
['JSON.MSET', '1', '$', '{ "a":"1" } ', '2', '$', '{ "b":"2"} ']
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.json.mGet', async client => {
|
|
assert.deepEqual(
|
|
await client.json.mGet(["1", "2"], "$", [{ a: 1 }, { b: 2 }]),
|
|
[null, null]
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|