Guest User

Untitled

a guest
Nov 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. r = Redis.new(options)
  2.  
  3. # classic:
  4. r.set('foo', 'bar')
  5. r.get('foo')
  6. r.sadd('baz', 1)
  7. # etc.
  8.  
  9. # this could be cool:
  10. k1 = r.key('foo')
  11. k1.set('bar')
  12. k1.get
  13. k2 = r.key('baz')
  14. k2.sadd(1)
  15.  
  16. # or even typed:
  17. k1 = r.key('foo') # defaults to string
  18. # ... as before
  19. k2 = r.key('baz', 'set')
  20. k2.add(1) # since it's a set, sadd could just become add
Add Comment
Please, Sign In to add comment