Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuhptr/pzn-redis
PZN Learn how to know using redis
https://github.com/nuhptr/pzn-redis
redis redis-client redis-cluster redis-pubsub redis-server
Last synced: about 2 months ago
JSON representation
PZN Learn how to know using redis
- Host: GitHub
- URL: https://github.com/nuhptr/pzn-redis
- Owner: nuhptr
- Created: 2023-10-08T14:57:35.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-10T13:23:09.000Z (11 months ago)
- Last Synced: 2024-02-10T14:29:15.793Z (11 months ago)
- Topics: redis, redis-client, redis-cluster, redis-pubsub, redis-server
- Homepage:
- Size: 12.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REDIS MEMORY DATABASE
https://redis.io/
## Running Redis
- redis-server
- redis-server config/redis.conf
- redis-cli -h localhost -p 6379### Data String
- set test "Hello World"
- get test
- exists test -> 1
- append test "add more hello world" -> get test
- keys \* -> list all keys
- key test\* -> list all keys that start with test
- del test (delete key) -> get test -> (nil)### Data Range
- set test "Hello World"
- get test -> setrange test 6 "Redis" -> get test### Multiple Data String
- mset key1 "Hello" key2 "World" key3 "Redis"
- mget key1 key2 key3### Expiration
- expire key 10 (seconds)
- setex key 10 "Hello" (set key and expiration)
- ttl key (time to live)### Increment and Decrement
- incr key
- decr key
- get key
- incrby key [value]
- decrby key [value]
- get key### Flush
- flushdb (delete all keys in current database)
- flushall (delete all keys in all databases)### Pipeline
- redis-cli -h host -p port -n database --pipe < input-file
(redis-cli -h localhost -p 6379 -n 0 --pipe < input-file.txt)### Transaction
- multi (start transaction)
- exec (execute transaction)
- discard (cancel transaction)### Config
- config get \* -> list all configurations
- config get \*max\* -> list all configurations that contains max
- config get maxmemory -> get maxmemory configuration
- config get databases
- config get bind
- config get save### Protected Mode
- redis-cli -h 192.168.1.101 -p 6379