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

some json and search commands

This commit is contained in:
Leibale
2023-08-01 14:29:34 -04:00
parent 2136418f1a
commit fd016ee1b2
21 changed files with 199 additions and 147 deletions

View File

@@ -1,13 +1,17 @@
import { RedisArgument, ArrayReply, NumberReply, NullReply, Command } from '@redis/client/dist/lib/RESP/types';
export interface JsonStrLenOptions {
path?: RedisArgument;
}
export default {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: false,
transformArguments(key: RedisArgument, path?: RedisArgument) {
IS_READ_ONLY: true,
transformArguments(key: RedisArgument, options?: JsonStrLenOptions) {
const args = ['JSON.STRLEN', key];
if (path) {
args.push(path);
if (options?.path) {
args.push(options.path);
}
return args;