etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

function signature of hmset #87

Closed Mullefa closed 9 years ago

Mullefa commented 9 years ago

Say I have a hash map in redis, and the fields I want values for are stored in a data structure in Scala such as a list. How would you suggest getting these values using your client. I figure hmget() would be better than iterating over the data structure with hget(), but I can't work out how to do it.

etaty commented 9 years ago

You have the tests here : https://github.com/etaty/rediscala/blob/master/src/test/scala/redis/commands/HashesSpec.scala

redis.hmget("key", "field1", "field2", "nofield")

you also have hgetall

redis.hgetall("key") you will receive all the fields for the key key

Mullefa commented 9 years ago

Sure, but what if I want to access the values for a group of fields that are stored in a list of arbitrary length?

etaty commented 9 years ago

You do redis.hmget("key", list: _*)

http://stackoverflow.com/questions/1832061/scala-pass-seq-to-var-args-functions

Mullefa commented 9 years ago

Ok, thanks. On 4 Sep 2015 11:57, "Valerian" notifications@github.com wrote:

You do redis.hmget("key", list: _*)

http://stackoverflow.com/questions/1832061/scala-pass-seq-to-var-args-functions

— Reply to this email directly or view it on GitHub https://github.com/etaty/rediscala/issues/87#issuecomment-137704404.