diff --git a/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala b/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala index 0736294..e9cac5d 100644 --- a/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala +++ b/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala @@ -696,11 +696,15 @@ object RedisCommands { def expire[F[_]: RedisCtx](key: String, seconds: Long): F[Boolean] = RedisCtx[F].keyed(key, NEL.of("EXPIRE", key.encode, seconds.encode)) - def mget[F[_]: RedisCtx](key: String): F[List[Option[String]]] = { + private[rediculous] def mget[F[_]: RedisCtx](key: String): F[List[Option[String]]] = { val cmd = NEL("MGET", key.encode :: Nil) RedisCtx[F].keyed(key, cmd) } + def mget[F[_]: RedisCtx](key: String, keys: String*): F[List[Option[String]]] = { + RedisCtx[F].keyed(key, NEL("MGET", (key :: keys.toList).map(_.encode))) + } + def bitpos[F[_]: RedisCtx](key: String, bit: Long, start: Long, end: Long): F[Long] = RedisCtx[F].keyed(key, NEL.of("BITPOS", key.encode, bit.encode, start.encode, end.encode)) @@ -769,9 +773,14 @@ object RedisCommands { def hsetnx[F[_]: RedisCtx](key: String, field: String, value: String): F[Boolean] = RedisCtx[F].keyed(key, NEL.of("HSETNX", key.encode, field.encode, value.encode)) - def mset[F[_]: RedisCtx](keyvalue: (String, String)): F[Status] = + private[rediculous] def mset[F[_]: RedisCtx](keyvalue: (String, String)): F[Status] = RedisCtx[F].keyed(keyvalue._1, NEL("MSET", List(keyvalue._1.encode, keyvalue._2.encode))) + def mset[F[_]: RedisCtx](keyValue: (String, String), keyValues: (String, String)*): F[List[Status]] = { + val command = NEL("MSET", (keyValue :: keyValues.toList).flatMap(t => List(t._1.encode, t._2.encode))) + RedisCtx[F].keyed(keyValue._1, command) + } + def setex[F[_]: RedisCtx](key: String, seconds: Long, value: String): F[Status] = RedisCtx[F].keyed(key, NEL.of("SETEX", key.encode, seconds.encode, value.encode))