Skip to content

Commit f521e51

Browse files
authored
the "keys have no pre-determined position" command specifies the position of the key (#1769)
1 parent ad4d0a5 commit f521e51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

commands.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,7 @@ func (c cmdable) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd {
23802380
}
23812381

23822382
cmd := NewStringSliceCmd(ctx, args...)
2383+
cmd.setFirstKeyPos(2)
23832384
_ = c(ctx, cmd)
23842385
return cmd
23852386
}
@@ -2395,6 +2396,7 @@ func (c cmdable) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
23952396
args[len(keys)+2] = "withscores"
23962397

23972398
cmd := NewZSliceCmd(ctx, args...)
2399+
cmd.setFirstKeyPos(2)
23982400
_ = c(ctx, cmd)
23992401
return cmd
24002402
}
@@ -2658,6 +2660,7 @@ func (c cmdable) MemoryUsage(ctx context.Context, key string, samples ...int) *I
26582660
args = append(args, "SAMPLES", samples[0])
26592661
}
26602662
cmd := NewIntCmd(ctx, args...)
2663+
cmd.setFirstKeyPos(2)
26612664
_ = c(ctx, cmd)
26622665
return cmd
26632666
}
@@ -2674,6 +2677,7 @@ func (c cmdable) Eval(ctx context.Context, script string, keys []string, args ..
26742677
}
26752678
cmdArgs = appendArgs(cmdArgs, args)
26762679
cmd := NewCmd(ctx, cmdArgs...)
2680+
cmd.setFirstKeyPos(3)
26772681
_ = c(ctx, cmd)
26782682
return cmd
26792683
}
@@ -2688,6 +2692,7 @@ func (c cmdable) EvalSha(ctx context.Context, sha1 string, keys []string, args .
26882692
}
26892693
cmdArgs = appendArgs(cmdArgs, args)
26902694
cmd := NewCmd(ctx, cmdArgs...)
2695+
cmd.setFirstKeyPos(3)
26912696
_ = c(ctx, cmd)
26922697
return cmd
26932698
}

0 commit comments

Comments
 (0)