karlseguin / the-little-redis-book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should rename keys to ids for consistency

matrush opened this issue · comments

Actually for this issue #32, there are two places need to be fixed in the book, and the commit 469405d just fixed one of them.

The keys in below code:

keys = redis.lrange('newusers', 0, 10)
redis.mget(*keys.map {|u| "users:#{u}"})

should be renamed for consistency. (as well a minor range issue: 10 to 9)

ids = redis.lrange('newusers', 0, 9)
redis.mget(*ids.map {|u| "users:#{u}"})

There is also a minor error in this sentence:

...anything you want sorted by an some integer...

thank you 👍