-
Notifications
You must be signed in to change notification settings - Fork 0
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 toupdate
the DB and is the main command. - The field after main command is the
key
and the rest alternating are thefields
and theirvalues
.
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 fieldartist
is extracted. - The result of the above operation on the DB is
Jimi Hendrix
.