@@ -10,6 +10,7 @@ import (
10
10
)
11
11
12
12
// KeepTTL is an option for Set command to keep key's existing TTL.
13
+ // It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
13
14
// For example:
14
15
//
15
16
// rdb.Set(ctx, key, value, redis.KeepTTL)
@@ -841,6 +842,7 @@ func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd {
841
842
//
842
843
// Zero expiration means the key has no expiration time.
843
844
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
845
+ // It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
844
846
func (c cmdable ) Set (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd {
845
847
args := make ([]interface {}, 3 , 5 )
846
848
args [0 ] = "set"
@@ -874,6 +876,7 @@ type SetArgs struct {
874
876
Get bool
875
877
876
878
// KeepTTL is a Redis KEEPTTL option to keep existing TTL.
879
+ // It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
877
880
KeepTTL bool
878
881
}
879
882
@@ -922,6 +925,7 @@ func (c cmdable) SetEX(ctx context.Context, key string, value interface{}, expir
922
925
//
923
926
// Zero expiration means the key has no expiration time.
924
927
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
928
+ // It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
925
929
func (c cmdable ) SetNX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd {
926
930
var cmd * BoolCmd
927
931
switch expiration {
@@ -946,6 +950,7 @@ func (c cmdable) SetNX(ctx context.Context, key string, value interface{}, expir
946
950
//
947
951
// Zero expiration means the key has no expiration time.
948
952
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
953
+ // It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
949
954
func (c cmdable ) SetXX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd {
950
955
var cmd * BoolCmd
951
956
switch expiration {
0 commit comments