OBJECT ENCODING · Valkey

OBJECT ENCODING

Returns the internal encoding of an object.

Usage

OBJECT ENCODING key

Description

Returns the internal encoding for the Valkey object stored at <key>

Valkey objects can be encoded in different ways:

All the specially encoded types are automatically converted to the general type once you perform an operation that makes it impossible for Valkey to retain the space saving encoding.

Reply RESP2

One of the following:

Reply RESP3

One of the following:

Complexity

O(1)

ACL Categories

@keyspace @read @slow

History

See also

COPY, DEL, DUMP, EXISTS, EXPIRE, EXPIREAT, EXPIRETIME, KEYS, MIGRATE, MOVE, OBJECT, OBJECT FREQ, OBJECT HELP, OBJECT IDLETIME, OBJECT REFCOUNT, PERSIST, PEXPIRE, PEXPIREAT, PEXPIRETIME, PTTL, RANDOMKEY, RENAME, RENAMENX, RESTORE, SCAN, SORT, SORT_RO, TOUCH, TTL, TYPE, UNLINK, WAIT, WAITAOF.