You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
RedisJSON
This commit is contained in:
@@ -4,11 +4,21 @@ import { RedisArgument, NumberReply, ArrayReply, NullReply, Command } from '@red
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
IS_READ_ONLY: false,
|
||||
transformArguments(key: RedisArgument, path: RedisArgument, ...jsons: Array<RedisJSON>) {
|
||||
const args = ['JSON.ARRAPPEND', key, path];
|
||||
transformArguments(
|
||||
key: RedisArgument,
|
||||
path: RedisArgument,
|
||||
json: RedisJSON,
|
||||
...jsons: Array<RedisJSON>
|
||||
) {
|
||||
const args = new Array<RedisArgument>(4 + jsons.length);
|
||||
args[0] = 'JSON.ARRAPPEND';
|
||||
args[1] = key;
|
||||
args[2] = path;
|
||||
args[3] = transformRedisJsonArgument(json);
|
||||
|
||||
for (const json of jsons) {
|
||||
args.push(transformRedisJsonArgument(json));
|
||||
let argsIndex = 4;
|
||||
for (let i = 0; i < jsons.length; i++) {
|
||||
args[argsIndex++] = transformRedisJsonArgument(jsons[i]);
|
||||
}
|
||||
|
||||
return args;
|
||||
|
Reference in New Issue
Block a user