You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
init time series
This commit is contained in:
23
packages/time-series/lib/commands/MADD.ts
Normal file
23
packages/time-series/lib/commands/MADD.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Timestamp, transformTimestampArgument } from '.';
|
||||
|
||||
interface MAddSample {
|
||||
key: string;
|
||||
timestamp: Timestamp;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export function transformArguments(toAdd: Array<MAddSample>): Array<string> {
|
||||
const args = ['TS.MADD'];
|
||||
|
||||
for (const { key, timestamp, value } of toAdd) {
|
||||
args.push(
|
||||
key,
|
||||
transformTimestampArgument(timestamp),
|
||||
value.toString()
|
||||
);
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
export declare function transformReply(): Array<number>;
|
Reference in New Issue
Block a user