Skip to content

Redis commands

Sumukha Pk edited this page Oct 3, 2019 · 2 revisions

conn.Do("HMSET", "album:2", "title", "Electric Ladyland", "artist", "Jimi Hendrix", "price", 4.95, "likes", 8)

  • Above is the operation on the Redis connection conn opened. HMSET is used to update the DB and is the main command.
  • The field after main command is the key and the rest alternating are the fields and their values.

conn.Do("HGET", "album:2", "artist")

  • Above is the operation in the Redis connection to GET the data from the DB.
  • Using the key of the DB, the field artist is extracted.
  • The result of the above operation on the DB is Jimi Hendrix.
Clone this wiki locally