docker run -d -p 6379:6379 redis
docker exec -it ${container_id} /bin/bash
SET userInfo "[{name : 'om', age : '21'}]" || SET username "sarthak"
GET userInfo || GET username
DEL userInfo || DEL username
HSET user:100 name "John Doe" email "user@example.com" age "30"
HGET user:100 name
HGET user:100 email
LPUSH => pushes from left
RPUSH => pushes from right
LPOP => pops from left in case the application needs stakc
RPOP => pops from right in case the application needs queue (preffered)
LPUSH ${key} "${value}"
RPUSH ${key} "${value}"
RPOP ${key}
LPOP ${key}
LPUSH problems "{problemId : 1, type : 'c++'}"
LPUSH problems "{problemId : 2, type : 'javascript'}"
LPUSH problems "{problemId : 3, type : 'java'}"
LPUSH problems "{problemId : 4, type : 'go'}"
Queue : ["{problemId : 4, type : 'go'}, {problemId : 3, type : 'java'}, {problemId : 2, type : 'javascript'}, {problemId : 1, type : 'c++'}"]
Queue : ["go, java, javascript, c++"]
RPOP problems (Pops c++)
Queue : ["go, java, javascript"]
LPOP problems (Pops go)
Queue : ["java, javascript"]
RPOP problems (Pops javascript)
Queue : ["java"]
RPOP problems (Pops java)
Queue : ["java"]
RPOP problems (will get nil if the queue is empty)
Queue : [] (nil)