diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/bitmaps.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/bitmaps.scala index ee82fe08..09709434 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/bitmaps.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/bitmaps.scala @@ -47,13 +47,13 @@ trait BitCommands[F[_], K, V] { def bitField(key: K, operations: BitCommandOperation*): F[List[Long]] - def bitOpAnd(destination: K, sources: K*): F[Unit] + def bitOpAnd(destination: K, source: K, sources: K*): F[Unit] def bitOpNot(destination: K, source: K): F[Unit] - def bitOpOr(destination: K, sources: K*): F[Unit] + def bitOpOr(destination: K, source: K, sources: K*): F[Unit] - def bitOpXor(destination: K, sources: K*): F[Unit] + def bitOpXor(destination: K, source: K, sources: K*): F[Unit] def bitPos(key: K, state: Boolean): F[Long] diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/geo.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/geo.scala index f07d3863..94550cd8 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/geo.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/geo.scala @@ -24,8 +24,8 @@ trait GeoCommands[F[_], K, V] extends GeoGetter[F, K, V] with GeoSetter[F, K, V] trait GeoGetter[F[_], K, V] { def geoDist(key: K, from: V, to: V, unit: GeoArgs.Unit): F[Double] - def geoHash(key: K, values: V*): F[List[Option[String]]] - def geoPos(key: K, values: V*): F[List[GeoCoordinate]] + def geoHash(key: K,value:V, values: V*): F[List[Option[String]]] + def geoPos(key: K,value:V, values: V*): F[List[GeoCoordinate]] def geoRadius(key: K, geoRadius: GeoRadius, unit: GeoArgs.Unit): F[Set[V]] def geoRadius(key: K, geoRadius: GeoRadius, unit: GeoArgs.Unit, args: GeoArgs): F[List[GeoRadiusResult[V]]] def geoRadiusByMember(key: K, value: V, dist: Distance, unit: GeoArgs.Unit): F[Set[V]] diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/keys.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/keys.scala index b8d27710..72a22b98 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/keys.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/keys.scala @@ -25,9 +25,9 @@ import scala.concurrent.duration.FiniteDuration trait KeyCommands[F[_], K] { def copy(source: K, destination: K): F[Boolean] def copy(source: K, destination: K, copyArgs: CopyArgs): F[Boolean] - def del(key: K*): F[Long] + def del(k: K, keys: K*): F[Long] def dump(key: K): F[Option[Array[Byte]]] - def exists(key: K*): F[Boolean] + def exists(key: K, keys: K*): F[Boolean] def expire(key: K, expiresIn: FiniteDuration): F[Boolean] def expire(key: K, expiresIn: FiniteDuration, expireExistenceArg: ExpireExistenceArg): F[Boolean] def expireAt(key: K, at: Instant): F[Boolean] diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/sortedsets.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/sortedsets.scala index f14cb279..c1a4bbe7 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/sortedsets.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/algebra/sortedsets.scala @@ -66,7 +66,7 @@ trait SortedSetSetter[F[_], K, V] { def zAddIncr(key: K, args: Option[ZAddArgs], value: ScoreWithValue[V]): F[Double] def zIncrBy(key: K, member: V, amount: Double): F[Double] def zInterStore(destination: K, args: Option[ZStoreArgs], keys: K*): F[Long] - def zRem(key: K, values: V*): F[Long] + def zRem(key: K, value: V, values: V*): F[Long] def zRemRangeByLex(key: K, range: ZRange[V]): F[Long] def zRemRangeByRank(key: K, start: Long, stop: Long): F[Long] def zRemRangeByScore[T: Numeric](key: K, range: ZRange[T]): F[Long] diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala index 6ed88a81..f06bcc39 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala @@ -476,14 +476,16 @@ private[redis4cats] class BaseRedis[F[_]: FutureLift: MonadThrow: Log, K, V]( override def copy(source: K, destination: K, copyArgs: CopyArgs): F[Boolean] = async.flatMap(_.copy(source, destination, copyArgs.asJava).futureLift.map(x => Boolean.box(x))) - def del(key: K*): F[Long] = - async.flatMap(_.del(key: _*).futureLift.map(x => Long.box(x))) + def del(k: K, keys: K*): F[Long] = + async.flatMap(_.del((k +: keys): _*).futureLift.map(x => Long.box(x))) override def dump(key: K): F[Option[Array[Byte]]] = async.flatMap(_.dump(key).futureLift.map(Option(_))) - override def exists(key: K*): F[Boolean] = - async.flatMap(_.exists(key: _*).futureLift.map(_ == key.size.toLong)) + override def exists(key: K, keys: K*): F[Boolean] = { + val all = key +: keys + async.flatMap(_.exists(all: _*).futureLift.map(_ == all.size.toLong)) + } /** * Expires a key with the given duration. If specified either in MILLISECONDS, MICROSECONDS or NANOSECONDS, @@ -948,17 +950,17 @@ private[redis4cats] class BaseRedis[F[_]: FutureLift: MonadThrow: Log, K, V]( override def bitPos(key: K, state: Boolean, start: Long, end: Long): F[Long] = async.flatMap(_.bitpos(key, state, start, end).futureLift.map(x => Long.box(x))) - override def bitOpAnd(destination: K, sources: K*): F[Unit] = - async.flatMap(_.bitopAnd(destination, sources: _*).futureLift.void) + override def bitOpAnd(destination: K, source: K, sources: K*): F[Unit] = + async.flatMap(_.bitopAnd(destination, (source +: sources): _*).futureLift.void) override def bitOpNot(destination: K, source: K): F[Unit] = async.flatMap(_.bitopNot(destination, source).futureLift.void) - override def bitOpOr(destination: K, sources: K*): F[Unit] = - async.flatMap(_.bitopOr(destination, sources: _*).futureLift.void) + override def bitOpOr(destination: K, source: K, sources: K*): F[Unit] = + async.flatMap(_.bitopOr(destination, (source +: sources): _*).futureLift.void) - override def bitOpXor(destination: K, sources: K*): F[Unit] = - async.flatMap(_.bitopXor(destination, sources: _*).futureLift.void) + override def bitOpXor(destination: K, source: K, sources: K*): F[Unit] = + async.flatMap(_.bitopXor(destination, (source +: sources): _*).futureLift.void) override def getBit(key: K, offset: Long): F[Option[Long]] = async.flatMap(_.getbit(key, offset).futureLift.map(x => Option(Long.unbox(x)))) @@ -970,14 +972,14 @@ private[redis4cats] class BaseRedis[F[_]: FutureLift: MonadThrow: Log, K, V]( override def geoDist(key: K, from: V, to: V, unit: GeoArgs.Unit): F[Double] = async.flatMap(_.geodist(key, from, to, unit).futureLift.map(x => Double.box(x))) - override def geoHash(key: K, values: V*): F[List[Option[String]]] = + override def geoHash(key: K, value: V, values: V*): F[List[Option[String]]] = async - .flatMap(_.geohash(key, values: _*).futureLift) + .flatMap(_.geohash(key, (value +: values): _*).futureLift) .map(_.asScala.toList.map(x => Option(x.getValue))) - override def geoPos(key: K, values: V*): F[List[GeoCoordinate]] = + override def geoPos(key: K, value: V, values: V*): F[List[GeoCoordinate]] = async - .flatMap(_.geopos(key, values: _*).futureLift) + .flatMap(_.geopos(key, (value +: values): _*).futureLift) .map(_.asScala.toList.map(c => GeoCoordinate(c.getX.doubleValue(), c.getY.doubleValue()))) override def geoRadius(key: K, geoRadius: GeoRadius, unit: GeoArgs.Unit): F[Set[V]] = @@ -1081,8 +1083,8 @@ private[redis4cats] class BaseRedis[F[_]: FutureLift: MonadThrow: Log, K, V]( res.map(x => Long.box(x)) } - override def zRem(key: K, values: V*): F[Long] = - async.flatMap(_.zrem(key, values: _*).futureLift.map(x => Long.box(x))) + override def zRem(key: K, value: V, values: V*): F[Long] = + async.flatMap(_.zrem(key, (value +: values): _*).futureLift.map(x => Long.box(x))) override def zRemRangeByLex(key: K, range: ZRange[V]): F[Long] = async