tips:db:redis

This is an old revision of the document!


redis

type hash for tables and rows

namespace:table:id

HSET gianoauth:realms:users:scipio name "Stefano Scipioni"
HSET gianoauth:realms:users:scipio username "scipio"
HSET gianoauth:realms:users:scipio password "hash"

add an INDEX with sets: collections of strings that are unordered and cannot contain duplicates

SADD gianoauth:realms:all-users gianoauth:realms:users:scipio

use multi exec to surround HSET and SADD

MULTI
HSET ...
HSET ...
SADD ...
EXEC
sudo apt install -y redis-server redis-tools
  • tips/db/redis.1509981566.txt.gz
  • Last modified: 2017/11/06 16:19
  • by scipio