@@ -10,6 +10,7 @@ import (
1010)
1111
1212// 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).
1314// For example:
1415//
1516// rdb.Set(ctx, key, value, redis.KeepTTL)
@@ -841,6 +842,7 @@ func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd {
841842//
842843// Zero expiration means the key has no expiration time.
843844// 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).
844846func (c cmdable ) Set (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd {
845847 args := make ([]interface {}, 3 , 5 )
846848 args [0 ] = "set"
@@ -874,6 +876,7 @@ type SetArgs struct {
874876 Get bool
875877
876878 // 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).
877880 KeepTTL bool
878881}
879882
@@ -922,6 +925,7 @@ func (c cmdable) SetEX(ctx context.Context, key string, value interface{}, expir
922925//
923926// Zero expiration means the key has no expiration time.
924927// 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).
925929func (c cmdable ) SetNX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd {
926930 var cmd * BoolCmd
927931 switch expiration {
@@ -946,6 +950,7 @@ func (c cmdable) SetNX(ctx context.Context, key string, value interface{}, expir
946950//
947951// Zero expiration means the key has no expiration time.
948952// 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).
949954func (c cmdable ) SetXX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd {
950955 var cmd * BoolCmd
951956 switch expiration {
0 commit comments