Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/time-series/lib/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function pushDuplicatePolicy(args: RedisCommandArguments, duplicatePolicy
export type RawLabels = Array<[label: string, value: string]>;

export type Labels = {
[label: string]: string;
[label: string]: string | Array<string>;
};

export function transformLablesReply(reply: RawLabels): Labels {
Expand All @@ -197,7 +197,13 @@ export function pushLabelsArgument(args: RedisCommandArguments, labels?: Labels)
args.push('LABELS');

for (const [label, value] of Object.entries(labels)) {
args.push(label, value);
if (Array.isArray(value)) {
for (const item of value) {
args.push(label, item);
}
} else {
args.push(label, value);
}
}
}

Expand Down