An open API service indexing awesome lists of open source software.

https://github.com/dking1342/redis-intro

An intro into redis with some examples and commands
https://github.com/dking1342/redis-intro

redis redis-cache redis-client redis-database redis-server

Last synced: about 1 month ago
JSON representation

An intro into redis with some examples and commands

Awesome Lists containing this project

README

          

# Redis
## Documentation
Documentation for Redis can be found here

## Examples
Examples of a practical usage of Redis can be found in this repo.

## Commands
The commands you can use with Redis can be found here

### Simple Commands

Data is stored in a key, value pair. The crud type of commands are:


SET key value - creating a record


GET key - retrieves a key, value pair


DEL key - deletes a key, value pair


EXISTS key - determine if key, value pair is there


KEYS pattern - retrieves all key, value pairs in storage matching the pattern


KEYS * - retrieves all key, value pairs in storage


FLUSHALL - clears the entire storage


TTL key - time to live for the key, value pair


EXPIRE key time - makes a key, value pair expire in t time


SETEX key time value - sets a key, value pair and have it expire in t time

### Different data types
#### Array

LRANGE key start stop - retrives an array


LPUSH key value - pushes the value to an array


RPUSH key value - add the value to the end of the array


LPOP key - pops the first value of the array and returns it


RPOP key - pops the last value of the array and returns it

#### Sets

SADD key member - adds a value to the set


SMEMBERS key - retrieves all the values of the set


SREM key - removes the set

#### Hash - no nesting

HSET key field value - inserts a key, value pair into the heap


HGET key field - retrieves a unique key, value pair from the heap


HGETALL key - retrieves all key, value pairs from the heap


HDEL key field - removes a key, value pair from the heap


HEXISTS key field - checks to see if key, value pair exists in the heap