redis

Redis

 

Starting Server

 

  • In redis home directory run below command
    • nohup ./redis-server &

 

Geting All Keys

keys *

Deleting Data

 

Data Types

 

  • users is stored as hash
  • channel is  hash
  • buffer as string to store events the (multi level hash)

User

users is stored as hash

Get

 

  • For getting all users list in redis cli
    • KEYS users*
  • For getting particular user data
    • hgetall users.amitab

 

Delete

 

  • deleting particular user
    • del users.rahul
  • To delete a particular key field in below example we are deleting _ command from hash users.amitab
    • hdel users.amitab  _command

 

Channels

 

  • for each gib there is two channel ,  ouside and inside.
  • the structure of  channels in redis : the channels has users key , which is the comma seperated users list which are presents in the channel
  • so for checking we need to split the comma separated list into an array  and perform the operations and then again save the comma separated list.

 

Get

 

  • keys channels*
  • hgetall channels.7-O

Delete

 

  • deleting particular channel

 

  • del channels.7-O
Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in redis. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s