Skip to main content

Supported Commands

Hint

This article is generated by AI translation.

  • Update count: Use executeUpdate / getUpdateCount to get the number of affected rows.
  • Result set: Use executeQuery / getResultSet to get the result set.

Hash Command Set

CommandReturnRowsResult
HDELValue--Number of fields deleted from the hash, not including non-existing fields. Returns 0 if the key does not exist.
HEXISTSResultSet1RESULT field, BOOLEAN type
HEXPIREResultSetmultipleRESULT field, LONG type
HEXPIREATResultSetmultipleRESULT field, LONG type
HEXPIRETIMEResultSetmultipleRESULT field, LONG type
HPEXPIREResultSetmultipleRESULT field, LONG type
HPEXPIREATResultSetmultipleRESULT field, LONG type
HPEXPIRETIMEResultSetmultipleRESULT field, LONG type
HGETResultSet1VALUE field, STRING type
HGETALLResultSetmultipleFIELD field, STRING type
VALUE field, STRING type
HINCRBYResultSet1VALUE field, LONG type
HKEYSResultSetmultipleFIELD field, STRING type
HLENResultSet1RESULT field, LONG type
HMGETResultSetmultipleVALUE field, STRING type
HSETValue--Number of fields added.
HMSETValue--Number of fields added.
HSETNXValue--Returns 0 if the field already exists; returns 1 if a new field was created.
HPERSISTResultSetmultipleRESULT field, LONG type
HTTLResultSetmultipleRESULT field, LONG type
HPTTLResultSetmultipleRESULT field, LONG type
HRANDFIELDResultSetmultipleFIELD field, STRING type
VALUE field, STRING type (when using WITHVALUES)
HSCANResultSetmultipleCURSOR field, STRING type
FIELD field, STRING type
VALUE field, STRING type (when not using NOVALUES)
HSTRLENResultSet1RESULT field, LONG type
HVALSResultSetmultipleVALUE field, STRING type

Keys Command Set

CommandReturnRowsResult
COPYValue--1 if successful; 0 if failed
DELValue--Integer > 0 if one or more keys removed; 0 if none of the specified keys exist
UNLINKResultSet1RESULT field, LONG type
DUMPResultSet1VALUE field, BYTES type
EXISTSResultSet1RESULT field, LONG type
EXPIREValue--1 if timeout was set; 0 otherwise.
EXPIREATValue--1 if timeout was set; 0 otherwise.
EXPIRETIMEResultSet1RESULT field, LONG type
PEXPIREValue--1 if timeout was set; 0 otherwise.
PEXPIREATValue--1 if timeout was set; 0 otherwise.
PEXPIRETIMEResultSet1RESULT field, LONG type
KEYSResultSetmultipleKEY field, STRING type (Note: the driver uses the scan command instead of the keys command)
OBJECT ENCODINGResultSet1RESULT field, STRING type
OBJECT FREQResultSet1RESULT field, LONG type
OBJECT IDLETIMEResultSet1RESULT field, LONG type
OBJECT REFCOUNTResultSet1RESULT field, LONG type
PERSISTValue--1 if the key currently has a timeout set; 0 otherwise
TTLResultSet1RESULT field, LONG type
PTTLResultSet1RESULT field, LONG type
RANDOMKEYResultSet1KEY field, STRING type
RENAMEValue--1 if key was renamed; 0 if target key already exists. (Determined by OK status code)
RENAMENXValue--1 if key was renamed; 0 if target key already exists.
SCANResultSetmultipleCURSOR field, STRING type
KEY field, STRING type
TOUCHValue--Number of keys that were TOUCHed.
TYPEResultSet1RESULT field, STRING type

List Command Set

CommandReturnRowsResult
LMOVEResultSet1ELEMENT field, STRING type
BLMOVEResultSet1ELEMENT field, STRING type
LMPOPResultSetmultipleKEY field, STRING type (returns Key from Key,ValueList structure)
ELEMENT field, STRING type
BLMPOPResultSetmultipleKEY field, STRING type (returns Key from Key,ValueList structure)
ELEMENT field, STRING type
LPOPResultSetmultipleELEMENT field, STRING type
RPOPResultSetmultipleELEMENT field, STRING type
BLPOPResultSetmultipleELEMENT field, STRING type
BRPOPResultSetmultipleELEMENT field, STRING type
RPOPLPUSHResultSet1ELEMENT field, STRING type
BRPOPLPUSHResultSet1ELEMENT field, STRING type
LINDEXResultSet1ELEMENT field, STRING type
LINSERTValue--Length of the list after insert; returns 0 when key doesn't exist; returns -1 when pivot not found.
LLENResultSet1RESULT field, LONG type
LPOSResultSetmultipleRESULT field, LONG type
LPUSHValue--Length of the list after the PUSH operation.
LPUSHXValue--Length of the list after the PUSH operation.
RPUSHValue--Length of the list after the PUSH operation.
RPUSHXValue--Length of the list after the PUSH operation.
LRANGEResultSetmultipleELEMENT field, STRING type
LREMValue--Number of removed elements.
LSETValue--1 if successful, 0 otherwise. (Success when status is "OK")
LTRIMValue--1 if successful, 0 otherwise. (Success when status is "OK")

Server Command Set

CommandReturnRowsResult
MOVEValue--1 if key was moved; 0 otherwise
WAITResultSet1REPLICAS field, LONG type
WAITAOFResultSet1LOCAL field, LONG type
REPLICAS field, LONG type
PINGResultSet1RESULT field, STRING type
ECHOResultSet1RESULT field, STRING type
SELECTValue--Returns 1 on success; throws exception otherwise

Set Command Set

CommandReturnRowsResult
SADDValue--Number of elements added to the set, not including elements already present.
SCARDResultSet1RESULT field, LONG type
SDIFFResultSetmultipleELEMENT field, STRING type
SDIFFSTOREValue--Number of elements in the resulting set.
SINTERResultSetmultipleELEMENT field, STRING type
SINTERCARDResultSet1RESULT field, LONG type
SINTERSTOREValue--Number of elements in the resulting set.
SISMEMBERResultSet1RESULT field, LONG type
SMISMEMBERResultSetmultipleRESULT field, BOOLEAN type
SMEMBERSResultSetmultipleELEMENT field, STRING type
SMOVEValue--1 if element was moved; 0 otherwise
SPOPResultSetmultipleELEMENT field, STRING type
SRANDMEMBERResultSetmultipleELEMENT field, STRING type
SREMValue--Number of members removed from the set, not including non-existing members.
SSCANResultSetmultipleCURSOR field, STRING type
ELEMENT field, STRING type
SUNIONResultSetmultipleELEMENT field, STRING type
SUNIONSTOREValue--Number of elements in the resulting set.

SortedSet Command Set

CommandReturnRowsResult
ZMPOPResultSetmultipleKEY field, STRING type
ELEMENT field, STRING type
SCORE field, DOUBLE type
BZMPOPResultSetmultipleKEY field, STRING type
ELEMENT field, STRING type
SCORE field, DOUBLE type
ZPOPMAXResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type
BZPOPMAXResultSet1KEY field, STRING type
ELEMENT field, STRING type
SCORE field, DOUBLE type
ZPOPMINResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type
BZPOPMINResultSet1KEY field, STRING type
ELEMENT field, STRING type
SCORE field, DOUBLE type
ZADDResultSet1RESULT field, DOUBLE type (when using INCR)
RESULT field, LONG type (when not using INCR)
ZCARDResultSet1RESULT field, LONG type
ZCOUNTResultSet1RESULT field, LONG type
ZDIFFResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZDIFFSTOREValue--Number of elements in the resulting sorted set.
ZINCRBYResultSet1SCORE field, DOUBLE type
ZINTERResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZINTERCARDResultSet1RESULT field, LONG type
ZINTERSTOREValue--Number of elements in the resulting sorted set.
ZLEXCOUNTResultSet1RESULT field, LONG type
ZSCOREResultSet1SCORE field, DOUBLE type
ZMSCOREResultSetmultipleSCORE field, DOUBLE type
ZRANDMEMBERResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZRANGEResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZRANGEBYLEXResultSetmultipleELEMENT field, STRING type
ZRANGEBYSCOREResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZRANGESTOREValue--Number of elements in the resulting sorted set.
ZRANKResultSet1SCORE field, DOUBLE type (when using WITHSCORES)
RANK field, LONG type
ZREVRANKResultSet1SCORE field, DOUBLE type (when using WITHSCORES)
RANK field, LONG type
ZREMValue--Number of members removed from the sorted set, not including non-existing members.
ZREMRANGEBYLEXValue--Number of members removed from the sorted set, not including non-existing members.
ZREMRANGEBYRANKValue--Number of members removed from the sorted set, not including non-existing members.
ZREMRANGEBYSCOREValue--Number of members removed from the sorted set, not including non-existing members.
ZREVRANGEResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZREVRANGEBYLEXResultSetmultipleELEMENT field, STRING type
ZREVRANGEBYSCOREResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZSCANResultSetmultipleCURSOR field, STRING type
ELEMENT field, STRING type
SCORE field, DOUBLE type
ZUNIONResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)
ZUNIONSTOREValue--Number of elements in the resulting sorted set.

String Command Set

CommandReturnRowsResult
SETValue/ResultSet--/1Value: When not using GET, returns 0 (not set) or 1 (set successfully)
ResultSet: When using GET, VALUE field, STRING type
GETResultSet1VALUE field, STRING type
INCRResultSet1VALUE field, LONG type
INCRBYResultSet1VALUE field, LONG type
DECRResultSet1VALUE field, LONG type
DECRBYResultSet1VALUE field, LONG type
APPENDResultSet1RESULT field, LONG type
GETDELResultSet1VALUE field, STRING type
GETEXResultSet1VALUE field, STRING type
GETRANGEResultSet1VALUE field, STRING type
GETSETResultSet1VALUE field, STRING type
MGETResultSetmultipleKEY field, STRING type
VALUE field, STRING type
MSETValue--Number of keys added.
MSETNXValue--Returns 0 if no keys were set (at least one key already exists); returns the number of keys if all keys were set.
PSETEXValue--Returns 1 if successful; 0 otherwise. (Success when status is "OK")
SETEXValue--Returns 1 if successful; 0 otherwise. (Success when status is "OK")
SETNXValue--1 if key was set; 0 otherwise
SETRANGEValue--Length of the string after modification.
STRLENResultSet1RESULT field, LONG type
SUBSTRResultSet1VALUE field, STRING type