1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

time-series

This commit is contained in:
Leibale
2023-07-11 13:11:13 -04:00
parent c515bc9571
commit 54c3a66c72
32 changed files with 879 additions and 933 deletions

View File

@@ -1,5 +1,4 @@
import { RedisArgument, TuplesReply, NumberReply, DoubleReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
import { pushLatestArgument } from '.';
export interface TsGetOptions {
LATEST?: boolean;
@@ -11,7 +10,13 @@ export default {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: true,
transformArguments(key: RedisArgument, options?: TsGetOptions) {
return pushLatestArgument(['TS.GET', key], options?.LATEST);
const args = ['TS.GET', key];
if (options?.LATEST) {
args.push('LATEST');
}
return args;
},
transformReply: {
2(reply: Resp2Reply<TsGetReply>) {