Skip to content

Instantly share code, notes, and snippets.

@mikepack
Created February 12, 2012 20:04
Show Gist options
  • Save mikepack/1810577 to your computer and use it in GitHub Desktop.
Save mikepack/1810577 to your computer and use it in GitHub Desktop.
artist_keys = REDIS.smembers('users:1')
artist_keys.map!{ |artist_id| "artists:#{artist_id}" } #=> ["artists:1", "artists:2", "artists:3"]
REDIS.sinter(*artist_keys) #=> ["2","3"] where 2 and 3 are user IDs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment