-1

I use redis 6.2.4,in the redis-cli i input command:

127.0.0.1:6379> set k5 3
OK
127.0.0.1:6379> type k5
string
127.0.0.1:6379> 

why the type of k5 is string but not number?

vlddlv4
  • 35
  • 4

1 Answers1

2

number is not a Redis (data) type.

I'm adding some links for your reference:


OBJECT ENCODING command may suit your need.

127.0.0.1:6379> set k5 3
OK
127.0.0.1:6379> OBJECT ENCODING k5
"int"
sazzad
  • 5,740
  • 6
  • 25
  • 42