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

RedisJSON

This commit is contained in:
Leibale
2023-09-05 18:19:31 -04:00
parent 5bab7fa6fd
commit c12dc79950
36 changed files with 271 additions and 308 deletions

View File

@@ -1,4 +1,5 @@
import { RedisArgument, Command, NullReply, NumberReply, ArrayReply } from '@redis/client/dist/lib/RESP/types';
import { transformRedisJsonArgument } from '.';
export interface JsonStrAppendOptions {
path?: RedisArgument;
@@ -7,14 +8,14 @@ export interface JsonStrAppendOptions {
export default {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: false,
transformArguments(key: RedisArgument, append: RedisArgument, options?: JsonStrAppendOptions) {
transformArguments(key: RedisArgument, append: string, options?: JsonStrAppendOptions) {
const args = ['JSON.STRAPPEND', key];
if (options?.path) {
if (options?.path !== undefined) {
args.push(options.path);
}
args.push(append);
args.push(transformRedisJsonArgument(append));
return args;
},
transformReply: undefined as unknown as () => NumberReply | ArrayReply<NullReply | NumberReply>