dice ~$
DiceDB instance is shared across all users.
BITCOUNT
Syntax
BITCOUNT key [start end]
Description
Counts the number of set bits (population counting) in a string. The optional start and end arguments specify a range of bytes to count.
BITOP
Syntax
BITOP operation destkey key [key ...]
Description
The BITOP command performs bitwise operations between strings (AND, OR, XOR, NOT) and stores the result in the destination key.
BITPOS
Syntax
BITPOS key bit [start] [end]
Description
The BITPOS command returns the position of the first bit set to 1 or 0 in a string, optionally looking within a specific range.
SET
Syntax
SET key value [NX | XX] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]
Description
The SET command in DiceDB is used to set the value of a key. If the key already holds a value, it is overwritten, regardless of its type. This is one of the most fundamental operations in DiceDB as it allows for both creating and updating key-value pairs.
GET
Syntax
GET key
Description
The GET command retrieves the value of a key. If the key does not exist, nil is returned.
DEL
Syntax
DEL key [key ...]
Description
The DEL command removes the specified keys. A key is ignored if it does not exist.
EXISTS
Syntax
EXISTS key [key ...]
Description
The EXISTS command checks if one or more keys exist. It returns the number of keys that exist.
INCR
Syntax
INCR key
Description
The INCR command increments the number stored at the key by one. If the key does not exist, it is set to 0 before performing the operation.
DECR
Syntax
DECR key
Description
The DECR command decrements the number stored at the key by one. If the key does not exist, it is set to 0 before performing the operation.
DECRBY
Syntax
DECRBY key decrement
Description
The DECRBY command decrements the number stored at key by the given decrement.
ECHO
Syntax
ECHO message
Description
The ECHO command returns the given message as a bulk string.
EXPIRE
Syntax
EXPIRE key seconds
Description
The EXPIRE command sets a timeout on key. After the timeout has expired, the key will be automatically deleted.
EXPIREAT
Syntax
EXPIREAT key timestamp
Description
The EXPIREAT command works exactly like EXPIRE but instead of specifying the number of seconds for the key to live, it takes an absolute Unix timestamp.
MGET
Syntax
MGET key [key ...]
Description
The MGET command retrieves the values of multiple keys. If a key does not exist, nil is returned for that key.
MSET
Syntax
MSET key value [key value ...]
Description
The MSET command sets the given keys to their respective values. This is a faster alternative to issuing multiple SET commands.
HSET
Syntax
HSET key field value [field value ...]
Description
The HSET command sets the specified fields to their respective values in a hash stored at key. If the key does not exist, a new key holding a hash is created.
HGET
Syntax
HGET key field
Description
The HGET command retrieves the value of a specific field from a hash stored at the key.
HDEL
Syntax
HDEL key field [field ...]
Description
The HDEL command removes the specified fields from a hash stored at key.
HGETALL
Syntax
HGETALL key
Description
The HGETALL command retrieves all fields and values of a hash stored at key.
HEXISTS
Syntax
HEXISTS key field
Description
The HEXISTS command returns if the field exists in the hash stored at key.
HLEN
Syntax
HLEN key
Description
The HLEN command returns the number of fields contained in the hash stored at key.
INCRBYFLOAT
Syntax
INCRBYFLOAT key increment
Description
The INCRBYFLOAT command increments the float value stored at key by the specified increment.
LPUSH
Syntax
LPUSH key value [value ...]
Description
The LPUSH command inserts the specified values at the head (left) of the list stored at key.
RPUSH
Syntax
RPUSH key value [value ...]
Description
The RPUSH command inserts the specified values at the tail (right) of the list stored at key.
LPOP
Syntax
LPOP key
Description
The LPOP command removes and returns the first element of the list stored at key.
RPOP
Syntax
RPOP key
Description
The RPOP command removes and returns the last element of the list stored at key.
SADD
Syntax
SADD key member [member ...]
Description
The SADD command adds the specified members to the set stored at key. If a member already exists, it is ignored.
SMEMBERS
Syntax
SMEMBERS key
Description
The SMEMBERS command retrieves all the members of the set stored at key.
PING
Syntax
PING
Description
The PING command checks if the server is running and returns a PONG response.
PFADD
Syntax
PFADD key element [element ...]
Description
The PFADD command adds elements to a HyperLogLog data structure stored at the specified key. If the key does not exist, a new HyperLogLog is created.
PFCOUNT
Syntax
PFCOUNT key
Description
The PFCOUNT command returns the approximated cardinality (number of unique elements) of the HyperLogLog data structure stored at the specified key.
PFMERGE
Syntax
PFMERGE destkey sourcekey [sourcekey ...]
Description
The PFMERGE command merges multiple HyperLogLog data structures into a single one, stored at destkey.
TTL
Syntax
TTL key
Description
The TTL command returns the remaining time to live of a key that has an expiration set. If the key does not exist, -2 is returned.
HELLO
Syntax
HELLO [version]
Description
The HELLO command is used to connect to the server and switch to the desired protocol. It can be used to specify a version of the protocol.
GETSET
Syntax
GETSET key value
Description
The GETSET command sets the value of a key and returns its old value. This operation is atomic.
GETEX
Syntax
GETEX key [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds]
Description
The GETEX command retrieves the value of a key and can set an expiration time for it in the same command.
GETDEL
Syntax
GETDEL key
Description
The GETDEL command retrieves the value of a key and deletes it in the same atomic operation.
COMMAND
Syntax
COMMAND [GET | INFO | LIST | RESTORE]
Description
The COMMAND command provides information about the commands supported by the server, including details like the command name and the number of calls.
JSON.INGEST
Syntax
JSON.INGEST key json
Description
The JSON.INGEST command allows you to insert a JSON document into a specified key. If the key already holds a value, it will be overwritten.
JSON.GET
Syntax
JSON.GET key [path]
Description
The JSON.GET command retrieves a JSON value from the specified key. You can specify a path to get a nested value.
JSON.SET
Syntax
JSON.SET key path json
Description
The JSON.SET command sets a JSON value at a specified path in the key. If the key does not exist, a new JSON document is created.
JSON.DEL
Syntax
JSON.DEL key [path]
Description
The JSON.DEL command removes a JSON value at a specified path in the key. If the path does not exist, no action is taken.
JSON.TYPE
Syntax
JSON.TYPE key [path]
Description
The JSON.TYPE command returns the type of a JSON value at the specified path. If the path does not exist, it returns null.
JSON.NUMINCRBY
Syntax
JSON.NUMINCRBY key path increment
Description
The JSON.NUMINCRBY command increments a numeric value at a specified path in the key by the given increment.
JSON.MERGE
Syntax
JSON.MERGE dest key1 [key2 ...]
Description
The JSON.MERGE command merges multiple JSON documents into a single destination key.
JSON.KEYS
Syntax
JSON.KEYS key [path]
Description
The JSON.KEYS command retrieves all keys from a JSON document at a specified path.
JSON.FILTER
Syntax
JSON.FILTER key path filter
Description
The JSON.FILTER command filters JSON data based on a specified filter condition.