mirror of
https://github.com/redis/go-redis.git
synced 2025-11-26 06:23:09 +03:00
feat(vectorset): add vrange command (#3543)
This commit is contained in:
@@ -26,6 +26,7 @@ type VectorSetCmdable interface {
|
||||
VSimWithScores(ctx context.Context, key string, val Vector) *VectorScoreSliceCmd
|
||||
VSimWithArgs(ctx context.Context, key string, val Vector, args *VSimArgs) *StringSliceCmd
|
||||
VSimWithArgsWithScores(ctx context.Context, key string, val Vector, args *VSimArgs) *VectorScoreSliceCmd
|
||||
VRange(ctx context.Context, key, start, end string, count int64) *StringSliceCmd
|
||||
}
|
||||
|
||||
type Vector interface {
|
||||
@@ -345,3 +346,13 @@ func (c cmdable) VSimWithArgsWithScores(ctx context.Context, key string, val Vec
|
||||
_ = c(ctx, cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// `VRANGE key start end count`
|
||||
// a negative count means to return all the elements in the vector set.
|
||||
// note: the API is experimental and may be subject to change.
|
||||
func (c cmdable) VRange(ctx context.Context, key, start, end string, count int64) *StringSliceCmd {
|
||||
args := []any{"vrange", key, start, end, count}
|
||||
cmd := NewStringSliceCmd(ctx, args...)
|
||||
_ = c(ctx, cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user