etaty / rediscala

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

LRANGE get id for each result #102

Closed eduardofcgo closed 8 years ago

eduardofcgo commented 8 years ago

Is there a way to get the id of each element returned by an LRANGE? Thanks.

etaty commented 8 years ago

I don't think so as the original command does not expose that ( http://redis.io/commands/lrange ) In scala, for if you want to have the index on a collection you can use zipWithIndex

1.

List("a", "b", "c").zipWithIndex = List(("a", 0), ("b", 1), ("c", 2))

http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Seq

On Sun, Nov 22, 2015 at 11:27 PM Eduardo Gonçalves notifications@github.com wrote:

Is there a way to get the id of each element returned by an LRANGE? Thanks.

— Reply to this email directly or view it on GitHub https://github.com/etaty/rediscala/issues/102.

eduardofcgo commented 8 years ago

I was mistaken to think that the original command exposed that feature. Thanks a lot for the suggestion, that will solve my current problem.