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

Support JSON.MERGE Command

This commit is contained in:
shacharPash
2023-05-17 13:43:48 +03:00
parent e3ee1d2763
commit 40c7df04c7
4 changed files with 53 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './MSET';
describe('MSET', () => {
testUtils.isVersionGreaterThanHook([2, 6]);
describe('transformArguments', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments([{ key: "key", path: "$", value: "json" }, { key: "key2", path: "$", value: "json2" }]),
['JSON.MSET', 'key', '$', '"json"', 'key2', '$', '"json2"']
);
});
});
testUtils.testWithClient('client.json.mSet', async client => {
assert.equal(
await client.json.mSet([{ key: "key", path: "$", value: "json" }, { key: "key2", path: "$", value: "json2" }]),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});