redis Redis String datatype


Redis provides a string datatype that is used to associate data with a particular key. Redis string are the most basic datatype available in Redis and one of the first datatypes that users learn to work with.

Strings are often associated with text data, but Redis strings are more like buffers that can be used to store a wide range of different data. Redis strings can be used to represent integers, floating point numbers, bitmaps, text, and binary data.


  • SET key value [EX seconds] [PX milliseconds] [NX|XX]
  • INCR key
  • INCRBY key increment
  • INCRBYFLOAT key increment
  • DECR key
  • DECRBY key decrement