package redis
- Alphabetic
- By Inheritance
- redis
- Scripting
- Streams
- Lists
- Strings
- SortedSets
- Shared
- Keys
- Geo
- Connection
- Scripting
- Streams
- SortedSets
- Strings
- Sets
- Lists
- Keys
- HyperLogLog
- Hashes
- Geo
- Connection
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type AbsTtl = AbsTtl.type
- Definition Classes
- Keys
- type Alpha = Alpha.type
- Definition Classes
- Keys
- type Changed = Changed.type
- Definition Classes
- SortedSets
- type Copy = Copy.type
- Definition Classes
- Keys
- type Id[+A] = A
- type Increment = Increment.type
- Definition Classes
- SortedSets
- sealed trait Input[-A] extends AnyRef
- type KeepTtl = KeepTtl.type
- Definition Classes
- Strings
- type MemberScores[+M] = Chunk[MemberScore[M]]
- Definition Classes
- SortedSets
- type MkStream = MkStream.type
- Definition Classes
- Streams
- type NoAck = NoAck.type
- Definition Classes
- Streams
- sealed trait Output[+A] extends AnyRef
- trait Redis extends AnyRef
- final class RedisCommand[-In, +Out] extends AnyRef
- final case class RedisConfig(host: String, port: Int) extends Product with Serializable
- sealed trait RedisError extends Throwable with NoStackTrace
- trait RedisExecutor extends AnyRef
- final case class RedisLive(codec: Codec, executor: RedisExecutor) extends Redis with Product with Serializable
- type Replace = Replace.type
- Definition Classes
- Keys
- sealed trait RespValue extends Product with Serializable
- sealed trait ResultBuilder extends AnyRef
- type StreamChunks[N, I, K, V] = Chunk[StreamChunk[N, I, K, V]]
- Definition Classes
- Streams
- type StreamEntries[I, K, V] = Chunk[StreamEntry[I, K, V]]
- Definition Classes
- Streams
- type WithCoord = WithCoord.type
- Definition Classes
- Geo
- type WithDist = WithDist.type
- Definition Classes
- Geo
- type WithForce = WithForce.type
- Definition Classes
- Streams
- type WithHash = WithHash.type
- Definition Classes
- Geo
- type WithJustId = WithJustId.type
- Definition Classes
- Streams
- type WithScores = WithScores.type
- Definition Classes
- SortedSets
- sealed case class Address(ip: InetAddress, port: Int) extends Product with Serializable
- Definition Classes
- Connection
- sealed case class ClientEvents(readable: Boolean = false, writable: Boolean = false) extends Product with Serializable
- Definition Classes
- Connection
- sealed trait ClientFlag extends AnyRef
- Definition Classes
- Connection
- sealed case class ClientInfo(id: Long, name: Option[String] = None, address: Option[Address] = None, localAddress: Option[Address] = None, fileDescriptor: Option[Long] = None, age: Option[zio.Duration] = None, idle: Option[zio.Duration] = None, flags: Set[ClientFlag] = Set.empty, databaseId: Option[Long] = None, subscriptions: Int = 0, patternSubscriptions: Int = 0, multiCommands: Int = 0, queryBufferLength: Option[Int] = None, queryBufferFree: Option[Int] = None, outputBufferLength: Option[Int] = None, outputListLength: Option[Int] = None, outputBufferMem: Option[Long] = None, events: ClientEvents = ClientEvents(), lastCommand: Option[String] = None, argvMemory: Option[Long] = None, totalMemory: Option[Long] = None, redirectionClientId: Option[Long] = None, user: Option[String] = None) extends Product with Serializable
- Definition Classes
- Connection
- sealed trait ClientKillFilter extends AnyRef
- Definition Classes
- Connection
- sealed trait ClientPauseMode extends AnyRef
- Definition Classes
- Connection
- sealed case class ClientTrackingFlags(clientSideCaching: Boolean, trackingMode: Option[ClientTrackingMode] = None, noLoop: Boolean = false, caching: Option[Boolean] = None, brokenRedirect: Boolean = false) extends Product with Serializable
- Definition Classes
- Connection
- sealed case class ClientTrackingInfo(flags: ClientTrackingFlags, redirect: ClientTrackingRedirect, prefixes: Set[String] = Set.empty) extends Product with Serializable
- Definition Classes
- Connection
- sealed trait ClientTrackingMode extends AnyRef
- Definition Classes
- Connection
- sealed trait ClientTrackingRedirect extends AnyRef
- Definition Classes
- Connection
- sealed trait ClientType extends AnyRef
- Definition Classes
- Connection
- sealed trait UnblockBehavior extends AnyRef
- Definition Classes
- Connection
- sealed case class GeoView(member: String, dist: Option[Double], hash: Option[Long], longLat: Option[(Geo.this)#LongLat]) extends Product with Serializable
- Definition Classes
- Geo
- sealed case class LongLat(longitude: Double, latitude: Double) extends Product with Serializable
- Definition Classes
- Geo
- sealed trait RadiusUnit extends AnyRef
- Definition Classes
- Geo
- case class StoreBoth(results: (Geo.this)#Store, distances: (Geo.this)#StoreDist) extends (Geo.this)#StoreOptions with Product with Serializable
- Definition Classes
- Geo
- sealed case class StoreDist(key: String) extends Product with Serializable
- Definition Classes
- Geo
- case class StoreDistances(distances: (Geo.this)#StoreDist) extends (Geo.this)#StoreOptions with Product with Serializable
- Definition Classes
- Geo
- sealed trait StoreOptions extends AnyRef
- Definition Classes
- Geo
- case class StoreResults(results: (Geo.this)#Store) extends (Geo.this)#StoreOptions with Product with Serializable
- Definition Classes
- Geo
- sealed case class Auth(password: String) extends Product with Serializable
- Definition Classes
- Keys
- sealed case class By(pattern: String) extends Product with Serializable
- Definition Classes
- Keys
- sealed case class Freq(frequency: String) extends Product with Serializable
- Definition Classes
- Keys
- sealed case class IdleTime(seconds: Long) extends Product with Serializable
- Definition Classes
- Keys
- sealed trait RedisType extends Product with Serializable
- Definition Classes
- Keys
- sealed case class ListMaxLen(count: Long) extends Product with Serializable
- Definition Classes
- Lists
- sealed trait Position extends AnyRef
- Definition Classes
- Lists
- sealed case class Rank(rank: Long) extends Product with Serializable
- Definition Classes
- Lists
- sealed trait Side extends AnyRef
- Definition Classes
- Lists
- sealed trait DebugMode extends AnyRef
- Definition Classes
- Scripting
- sealed case class Count(count: Long) extends Product with Serializable
- Definition Classes
- Shared
- sealed case class Limit(offset: Long, count: Long) extends Product with Serializable
- Definition Classes
- Shared
- sealed trait Order extends AnyRef
- Definition Classes
- Shared
- sealed case class Pattern(pattern: String) extends Product with Serializable
- Definition Classes
- Shared
- sealed case class Store(key: String) extends Product with Serializable
- Definition Classes
- Shared
- sealed trait Update extends AnyRef
- Definition Classes
- Shared
- sealed trait Aggregate extends Product
- Definition Classes
- SortedSets
- sealed trait LexMaximum extends AnyRef
- Definition Classes
- SortedSets
- sealed trait LexMinimum extends AnyRef
- Definition Classes
- SortedSets
- sealed case class LexRange(min: LexMinimum, max: LexMaximum) extends Product with Serializable
- Definition Classes
- SortedSets
- sealed case class MemberScore[+M](score: Double, member: M) extends Product with Serializable
- Definition Classes
- SortedSets
- sealed trait ScoreMaximum extends AnyRef
- Definition Classes
- SortedSets
- sealed trait ScoreMinimum extends AnyRef
- Definition Classes
- SortedSets
- sealed case class ScoreRange(min: ScoreMinimum, max: ScoreMaximum) extends Product with Serializable
- Definition Classes
- SortedSets
- sealed case class Group[G, C](group: G, consumer: C) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class PendingInfo(total: Long, first: Option[String], last: Option[String], consumers: Map[String, Long]) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class PendingMessage(id: String, owner: String, lastDelivered: zio.Duration, counter: Long) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamChunk[N, I, K, V](name: N, entries: Chunk[StreamEntry[I, K, V]]) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamConsumersInfo(name: String, pending: Long, idle: zio.Duration) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamEntry[I, K, V](id: I, fields: Map[K, V]) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamGroupsInfo(name: String, consumers: Long, pending: Long, lastDeliveredId: String) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamInfo[I, K, V](length: Long, radixTreeKeys: Long, radixTreeNodes: Long, groups: Long, lastGeneratedId: String, firstEntry: Option[StreamEntry[I, K, V]], lastEntry: Option[StreamEntry[I, K, V]]) extends Product with Serializable
- Definition Classes
- Streams
- sealed case class StreamMaxLen(approximate: Boolean, count: Long) extends Product with Serializable
- Definition Classes
- Streams
- sealed trait XGroupCommand extends AnyRef
- Definition Classes
- Streams
- sealed trait BitFieldCommand extends AnyRef
- Definition Classes
- Strings
- sealed trait BitFieldType extends AnyRef
- Definition Classes
- Strings
- sealed trait BitOperation extends AnyRef
- Definition Classes
- Strings
- sealed case class BitPosRange(start: Long, end: Option[Long]) extends Product with Serializable
- Definition Classes
- Strings
- sealed trait Expire extends AnyRef
- Definition Classes
- Strings
- sealed trait ExpiredAt extends AnyRef
- Definition Classes
- Strings
- sealed trait LcsOutput extends AnyRef
- Definition Classes
- Strings
- case class Match(matchIdxA: MatchIdx, matchIdxB: MatchIdx, matchLength: Option[Long] = None) extends Product with Serializable
- Definition Classes
- Strings
- case class MatchIdx(start: Long, end: Long) extends Product with Serializable
- Definition Classes
- Strings
- sealed trait StrAlgoLCS extends AnyRef
- Definition Classes
- Strings
- sealed trait StrAlgoLcsQueryType extends AnyRef
- Definition Classes
- Strings
Value Members
- final def append[K, V](key: K, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Append a value to a key.
Append a value to a key.
- key
Key of the string to add the value to
- value
Value to append to the string
- returns
Returns the length of the string after the append operation.
- Definition Classes
- Strings
- final def auth(password: String): ZIO[Redis, RedisError, Unit]
Authenticates the current connection to the server in two cases:
Authenticates the current connection to the server in two cases:
- If the Redis server is password protected via the the requirepass option
- If a Redis 6.0 instance, or greater, is using the Redis ACL system. In this case it is assumed that the implicit username is default.
- password
the password used to authenticate the connection
- returns
if the password provided via AUTH matches the password in the configuration file, the Unit value is returned and the server starts accepting commands. Otherwise, an error is returned and the client needs to try a new password.
- Definition Classes
- Connection
- final def bitCount[K](key: K, range: Option[Range] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Count set bits in a string.
Count set bits in a string.
- key
Key of the string of which to count the bits
- range
Range of bytes to count
- returns
Returns the number of bits set to 1.
- Definition Classes
- Strings
- final def bitField[K](key: K, bitFieldCommand: BitFieldCommand, bitFieldCommands: BitFieldCommand*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Chunk[Option[Long]]]
Perform arbitrary bitfield integer operations on strings.
Perform arbitrary bitfield integer operations on strings.
- key
Key of the string to operate on
- bitFieldCommand
First command to apply
- bitFieldCommands
Subsequent commands to apply
- returns
Returns an optional long result of each command applied.
- Definition Classes
- Strings
- final def bitOp[D, S](operation: BitOperation, destKey: D, srcKey: S, srcKeys: S*)(implicit arg0: Schema[D], arg1: Schema[S]): ZIO[Redis, RedisError, Long]
Perform bitwise operations between strings.
Perform bitwise operations between strings.
- operation
Bit operation to apply
- destKey
Key of destination string to store the result
- srcKey
First source key to apply the operation to
- srcKeys
Subsequent source keys to apply the operation to
- returns
Returns size of the string stored in the destination key, that is equal to the size of the longest input string.
- Definition Classes
- Strings
- final def bitPos[K](key: K, bit: Boolean, range: Option[BitPosRange] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Find first bit set or clear in a string.
Find first bit set or clear in a string.
- key
Key of the string to search within
- bit
Whether to search for a set bit or a cleared bit
- range
Range of bytes to search
- returns
Returns the position of the first bit set to 1 or 0 according to the request.
- Definition Classes
- Strings
- final def blMove[S, D](source: S, destination: D, sourceSide: Side, destinationSide: Side, timeout: zio.Duration)(implicit arg0: Schema[S], arg1: Schema[D]): ResultBuilder1[Option]
BLMOVE is the blocking variant of LMOVE.
BLMOVE is the blocking variant of LMOVE. When source contains elements, this command behaves exactly like LMOVE. When used inside a MULTI/EXEC block, this command behaves exactly like zio.redis.api.Lists#lMove. When source is empty, Redis will block the connection until another client pushes to it or until timeout is reached. A timeout of zero can be used to block indefinitely.
- source
the key where the element is removed
- destination
the key where the element is inserted
- sourceSide
the side where the element is removed
- destinationSide
the side where the element is inserted
- timeout
the timeout in seconds
- returns
the element which is moved or nil when the timeout is reached.
- Definition Classes
- Lists
- final def blPop[K](key: K, keys: K*)(timeout: zio.Duration)(implicit arg0: Schema[K]): ResultBuilder1[[x]Option[(K, x)]]
Removes and gets the first element in a list, or blocks until one is available.
Removes and gets the first element in a list, or blocks until one is available. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.
- key
the key identifier of the first list to be checked
- keys
the key identifiers of the rest of the lists
- timeout
the maximum time to wait until an element is available. A timeout of zero can be used to block indefinitely
- returns
a tuple with the first element being the name of the key where an element was popped and the second element being the value of the popped element. An empty value is returned when no element could be popped and the timeout expired.
- Definition Classes
- Lists
- final def brPop[K](key: K, keys: K*)(timeout: zio.Duration)(implicit arg0: Schema[K]): ResultBuilder1[[x]Option[(K, x)]]
Removes and gets the last element in a list, or block until one is available.
Removes and gets the last element in a list, or block until one is available. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given.
- key
the key identifier of the first list to be checked
- keys
the key identifiers of the rest of the lists
- timeout
the maximum time to wait until an element is available. A timeout of zero can be used to block indefinitely
- returns
a tuple with the first element being the name of the key where an element was popped and the second element being the value of the popped element. An empty value is returned when no element could be popped and the timeout expired.
- Definition Classes
- Lists
- final def brPopLPush[S, D](source: S, destination: D, timeout: zio.Duration)(implicit arg0: Schema[S], arg1: Schema[D]): ResultBuilder1[Option]
Pops an element from the list stored at source, pushes it to the list stored at destination; or block until one is available.
Pops an element from the list stored at source, pushes it to the list stored at destination; or block until one is available. This is the blocking variant of zio.redis.api.Lists#rPopLPush.
- source
the key identifier of the source list
- destination
the key identifier of the target list
- timeout
the maximum time to wait for an element to be available. A timeout of zero can be used to block indefinitely
- returns
the element being popped from source and pushed to destination. If timeout is reached, an empty reply is returned.
- Definition Classes
- Lists
- final def bzPopMax[K](timeout: zio.Duration, key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[[x]Option[(K, MemberScore[x])]]
Remove and return the member with the highest score from one or more sorted sets, or block until one is available.
Remove and return the member with the highest score from one or more sorted sets, or block until one is available.
- timeout
Maximum number of seconds to block. A timeout of zero can be used to block indefinitely
- key
Key of the set
- keys
Keys of the rest sets
- returns
A three-element Chunk with the first element being the name of the key where a member was popped, the second element is the popped member itself, and the third element is the score of the popped element. An empty chunk is returned when no element could be popped and the timeout expired.
- Definition Classes
- SortedSets
- final def bzPopMin[K](timeout: zio.Duration, key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[[x]Option[(K, MemberScore[x])]]
Remove and return the member with the lowest score from one or more sorted sets, or block until one is available.
Remove and return the member with the lowest score from one or more sorted sets, or block until one is available.
- timeout
Maximum number of seconds to block. A timeout of zero can be used to block indefinitely
- key
Key of the set
- keys
Keys of the rest sets
- returns
A three-element Chunk with the first element being the name of the key where a member was popped, the second element is the popped member itself, and the third element is the score of the popped element. An empty chunk is returned when no element could be popped and the timeout expired.
- Definition Classes
- SortedSets
- final def clientCaching(track: Boolean): ZIO[Redis, RedisError, Unit]
Controls the tracking of the keys in the next command executed by the connection, when tracking is enabled in Optin or Optout mode.
Controls the tracking of the keys in the next command executed by the connection, when tracking is enabled in Optin or Optout mode.
- track
specifies whether to enable the tracking of the keys in the next command or not
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientGetName: ZIO[Redis, RedisError, Option[String]]
Returns the name of the current connection as set by clientSetName
Returns the name of the current connection as set by clientSetName
- returns
the connection name, or None if a name wasn't set.
- Definition Classes
- Connection
- final def clientGetRedir: ZIO[Redis, RedisError, ClientTrackingRedirect]
Returns the client ID we are redirecting our tracking notifications to
Returns the client ID we are redirecting our tracking notifications to
- returns
the client ID if the tracking is enabled and the notifications are being redirected
- Definition Classes
- Connection
- final def clientId: ZIO[Redis, RedisError, Long]
Returns the ID of the current connection.
Returns the ID of the current connection. Every connection ID has certain guarantees:
- It is never repeated, so if clientID returns the same number, the caller can be sure that the underlying client did not disconnect and reconnect the connection, but it is still the same connection.
- The ID is monotonically incremental. If the ID of a connection is greater than the ID of another connection, it is guaranteed that the second connection was established with the server at a later time.
- returns
the ID of the current connection.
- Definition Classes
- Connection
- final def clientKill(filters: ClientKillFilter*): ZIO[Redis, RedisError, Long]
Closes client connections with the specified filters.The following filters are available:
Closes client connections with the specified filters.The following filters are available:
- Address(ip, port). Kill all clients connected to specified address
- LocalAddress(ip, port). Kill all clients connected to specified local (bind) address
- Id(id). Allows to kill a client by its unique ID field. Client ID's are retrieved using the CLIENT LIST command
- ClientType, where the type is one of normal, master, replica and pubsub. This closes the connections of all the clients in the specified class. Note that clients blocked into the MONITOR command are considered to belong to the normal class
- User(username). Closes all the connections that are authenticated with the specified ACL username, however it returns an error if the username does not map to an existing ACL user
- SkipMe(skip). By default this option is set to yes, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command It is possible to provide multiple filters at the same time. The command will handle multiple filters via logical AND
- filters
the specified filters for killing clients
- returns
the number of clients killed.
- Definition Classes
- Connection
- final def clientKill(address: Address): ZIO[Redis, RedisError, Unit]
Closes a given client connection with the specified address
Closes a given client connection with the specified address
- address
the address of the client to kill
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientPause(timeout: zio.Duration, mode: Option[ClientPauseMode] = None): ZIO[Redis, RedisError, Unit]
Able to suspend all the Redis clients for the specified amount of time (in milliseconds).
Able to suspend all the Redis clients for the specified amount of time (in milliseconds). Currently supports two modes:
- All: This is the default mode. All client commands are blocked
- Write: Clients are only blocked if they attempt to execute a write command
- timeout
the length of the pause in milliseconds
- mode
option to specify the client pause mode
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientSetName(name: String): ZIO[Redis, RedisError, Unit]
Assigns a name to the current connection
Assigns a name to the current connection
- name
the name to be assigned
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientTrackingInfo: ZIO[Redis, RedisError, ClientTrackingInfo]
Returns information about the current client connection's use of the server assisted client side caching feature
Returns information about the current client connection's use of the server assisted client side caching feature
- returns
tracking information.
- Definition Classes
- Connection
- final def clientTrackingOff: ZIO[Redis, RedisError, Unit]
Disables the tracking feature of the Redis server, that is used for server assisted client side caching
Disables the tracking feature of the Redis server, that is used for server assisted client side caching
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientTrackingOn(redirect: Option[Long] = None, trackingMode: Option[ClientTrackingMode] = None, noLoop: Boolean = false, prefixes: Set[String] = Set.empty): ZIO[Redis, RedisError, Unit]
Enables the tracking feature of the Redis server, that is used for server assisted client side caching.
Enables the tracking feature of the Redis server, that is used for server assisted client side caching. The feature will remain active in the current connection for all its life, unless tracking is turned off with clientTrackingOff
- redirect
the ID of the connection we want to send invalidation messages to
- trackingMode
the mode used for tracking
- noLoop
no loop option
- prefixes
the prefixes registered
- returns
the Unit value.
- Definition Classes
- Connection
- final def clientUnblock(clientId: Long, error: Option[UnblockBehavior] = None): ZIO[Redis, RedisError, Boolean]
Unblocks, from a different connection, a client blocked in a blocking operation
Unblocks, from a different connection, a client blocked in a blocking operation
- clientId
the ID of the client to unblock
- error
option to specify the unblocking behavior
- returns
true if the client was unblocked successfully, or false if the client wasn't unblocked.
- Definition Classes
- Connection
- final def clientUnpause: ZIO[Redis, RedisError, Unit]
Resumes command processing for all clients that were paused by clientPause
Resumes command processing for all clients that were paused by clientPause
- returns
the Unit value.
- Definition Classes
- Connection
- final def decr[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Decrement the integer value of a key by one.
Decrement the integer value of a key by one.
- key
Key to decrement
- returns
Returns the value of key after the decrement.
- Definition Classes
- Strings
- final def decrBy[K](key: K, decrement: Long)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Decrement the integer value of a key by the given number.
Decrement the integer value of a key by the given number.
- key
Key of the integer value to decrement
- decrement
Amount to decrement by
- returns
Returns the value of key after the decrement.
- Definition Classes
- Strings
- final def del[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Removes the specified keys.
- final def dump[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Chunk[Byte]]
Serialize the value stored at key in a Redis-specific format and return it to the user.
Serialize the value stored at key in a Redis-specific format and return it to the user.
- key
key
- returns
bytes for value stored at key.
- Definition Classes
- Keys
- final def echo(message: String): ZIO[Redis, RedisError, String]
Echoes the given string.
Echoes the given string.
- message
the message to be echoed
- returns
the message.
- Definition Classes
- Connection
- def eval[K, A](script: String, keys: Chunk[K], args: Chunk[A])(implicit arg0: Input[K], arg1: Input[A]): ResultOutputBuilder
Evaluates a Lua script.
Evaluates a Lua script.
- script
Lua script
- keys
keys available through KEYS param in the script
- args
values available through ARGV param in the script
- returns
redis protocol value that is converted from the Lua type. You have to write decoder that would convert redis protocol value to a suitable type for your app
- Definition Classes
- Scripting
- def evalSha[K, A](sha1: String, keys: Chunk[K], args: Chunk[A])(implicit arg0: Input[K], arg1: Input[A]): ResultOutputBuilder
Evaluates a Lua script cached on the server side by its SHA1 digest.
Evaluates a Lua script cached on the server side by its SHA1 digest. Scripts could be cached using the zio.redis.api.Scripting.scriptLoad method.
- sha1
SHA1 digest
- keys
keys available through KEYS param in the script
- args
values available through ARGV param in the script
- returns
redis protocol value that is converted from the Lua type. You have to write decoder that would convert redis protocol value to a suitable type for your app
- Definition Classes
- Scripting
- final def exists[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
The number of keys existing among the ones specified as arguments.
The number of keys existing among the ones specified as arguments. Keys mentioned multiple times and existing are counted multiple times.
- key
one required key
- keys
maybe rest of the keys
- returns
The number of keys existing.
- Definition Classes
- Keys
- final def expire[K](key: K, timeout: zio.Duration)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Set a timeout on key.
- final def expireAt[K](key: K, timestamp: Instant)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Deletes the key at the specific timestamp.
- final def geoAdd[K, M](key: K, item: (LongLat, M), items: (LongLat, M)*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Adds the specified geospatial
items
(latitude, longitude, name) to the specifiedkey
.Adds the specified geospatial
items
(latitude, longitude, name) to the specifiedkey
.- key
sorted set where the items will be stored
- item
tuple of (latitude, longitude, name) to add
- items
additional items
- returns
number of new elements added to the sorted set.
- Definition Classes
- Geo
- final def geoDist[K, M](key: K, member1: M, member2: M, radiusUnit: Option[RadiusUnit] = None)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Option[Double]]
Return the distance between two members in the geospatial index represented by the sorted set.
Return the distance between two members in the geospatial index represented by the sorted set.
- key
sorted set of geospatial members
- member1
member in set
- member2
member in set
- radiusUnit
Unit of distance ("m", "km", "ft", "mi")
- returns
distance between the two specified members in the specified unit or None if either member is missing.
- Definition Classes
- Geo
- final def geoHash[K, M](key: K, member: M, members: M*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Chunk[Option[String]]]
Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index.
Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index.
- key
sorted set of geospatial members
- member
member in set
- members
additional members
- returns
chunk of geohashes, where value is
None
if a member is not in the set.
- Definition Classes
- Geo
- final def geoPos[K, M](key: K, member: M, members: M*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Chunk[Option[LongLat]]]
Return the positions (longitude, latitude) of all the specified members of the geospatial index represented by the sorted set at
key
.Return the positions (longitude, latitude) of all the specified members of the geospatial index represented by the sorted set at
key
.- key
sorted set of geospatial members
- member
member in the set
- members
additional members
- returns
chunk of positions, where value is
None
if a member is not in the set.
- Definition Classes
- Geo
- final def geoRadius[K](key: K, center: LongLat, radius: Double, radiusUnit: RadiusUnit, withCoord: Option[WithCoord] = None, withDist: Option[WithDist] = None, withHash: Option[WithHash] = None, count: Option[Count] = None, order: Option[Order] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Chunk[GeoView]]
Return geospatial members of a sorted set which are within the area specified with a *center location* and the *maximum distance from the center*.
Return geospatial members of a sorted set which are within the area specified with a *center location* and the *maximum distance from the center*.
- key
sorted set of geospatial members
- center
position
- radius
distance from the center
- radiusUnit
Unit of distance ("m", "km", "ft", "mi")
- withCoord
flag to include the position of each member in the result
- withDist
flag to include the distance of each member from the center in the result
- withHash
flag to include raw geohash sorted set score of each member in the result
- count
limit the results to the first N matching items
- order
sort returned items in the given
Order
- returns
chunk of members within the specified are.
- Definition Classes
- Geo
- final def geoRadiusByMember[K, M](key: K, member: M, radius: Double, radiusUnit: RadiusUnit, withCoord: Option[WithCoord] = None, withDist: Option[WithDist] = None, withHash: Option[WithHash] = None, count: Option[Count] = None, order: Option[Order] = None)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Chunk[GeoView]]
Return geospatial members of a sorted set which are within the area specified with an *existing member* in the set and the *maximum distance from the location of that member*.
Return geospatial members of a sorted set which are within the area specified with an *existing member* in the set and the *maximum distance from the location of that member*.
- key
sorted set of geospatial members
- member
member in the set
- radius
distance from the member
- radiusUnit
Unit of distance ("m", "km", "ft", "mi")
- withCoord
flag to include the position of each member in the result
- withDist
flag to include the distance of each member from the center in the result
- withHash
flag to include raw geohash sorted set score of each member in the result
- count
limit the results to the first N matching items
- order
sort returned items in the given
Order
number should be stored- returns
chunk of members within the specified area, or an error if the member is not in the set.
- Definition Classes
- Geo
- final def geoRadiusByMemberStore[K, M](key: K, member: M, radius: Double, radiusUnit: RadiusUnit, store: StoreOptions, withCoord: Option[WithCoord] = None, withDist: Option[WithDist] = None, withHash: Option[WithHash] = None, count: Option[Count] = None, order: Option[Order] = None)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Similar to geoRadiusByMember, but store the results to the argument passed to store and return the number of elements stored.
Similar to geoRadiusByMember, but store the results to the argument passed to store and return the number of elements stored. Added as a separate Scala function because it returns a Long instead of the list of results. Find geospatial members of a sorted set which are within the area specified with an *existing member* in the set and the *maximum distance from the location of that member*.
- key
sorted set of geospatial members
- member
member in the set
- radius
distance from the member
- radiusUnit
Unit of distance ("m", "km", "ft", "mi")
- store
sorted set where the results and/or distances should be stored
- withCoord
flag to include the position of each member in the result
- withDist
flag to include the distance of each member from the center in the result
- withHash
flag to include raw geohash sorted set score of each member in the result
- count
limit the results to the first N matching items
- order
sort returned items in the given
Order
- returns
chunk of members within the specified area, or an error if the member is not in the set. We expect at least one of Option[Store] and Option[StoreDist] to be passed here.
- Definition Classes
- Geo
- final def geoRadiusStore[K](key: K, center: LongLat, radius: Double, radiusUnit: RadiusUnit, store: StoreOptions, withCoord: Option[WithCoord] = None, withDist: Option[WithDist] = None, withHash: Option[WithHash] = None, count: Option[Count] = None, order: Option[Order] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Similar to geoRadius, but store the results to the argument passed to store and return the number of elements stored.
Similar to geoRadius, but store the results to the argument passed to store and return the number of elements stored. Added as a separate Scala function because it returns a Long instead of the list of results. Find the geospatial members of a sorted set which are within the area specified with a *center location* and the *maximum distance from the center*.
- key
sorted set of geospatial members
- center
position
- radius
distance from the center
- radiusUnit
Unit of distance ("m", "km", "ft", "mi")
- store
sorted set where the results and/or distances should be stored
- withCoord
flag to include the position of each member in the result
- withDist
flag to include the distance of each member from the center in the result
- withHash
flag to include raw geohash sorted set score of each member in the result
- count
limit the results to the first N matching items
- order
sort returned items in the given
Order
- returns
chunk of members within the specified are. We expect at least one of Option[Store] and Option[StoreDist] to be passed here.
- Definition Classes
- Geo
- final def get[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get the value of a key.
Get the value of a key.
- key
Key to get the value of
- returns
Returns the value of the string or None if it does not exist.
- Definition Classes
- Strings
- final def getBit[K](key: K, offset: Long)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Returns the bit value at offset in the string value stored at key.
Returns the bit value at offset in the string value stored at key.
- key
Key of the string to get the bit from
- offset
Offset to the bit
- returns
Returns the bit value stored at offset.
- Definition Classes
- Strings
- final def getDel[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get the string value of a key and delete it on success (if and only if the key's value type is a string).
Get the string value of a key and delete it on success (if and only if the key's value type is a string).
- key
Key to get the value of
- returns
Returns the value of the string or None if it did not previously have a value.
- Definition Classes
- Strings
- final def getEx[K](key: K, persist: Boolean)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get the value of key and remove the time to live associated with the key.
Get the value of key and remove the time to live associated with the key.
- key
Key to get the value of
- persist
if true, remove the time to live associated with the key, otherwise not
- returns
Returns the value of the string or None if it did not previously have a value.
- Definition Classes
- Strings
- final def getEx[K](key: K, expiredAt: ExpiredAt, timestamp: Instant)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get the value of key and set its expiration.
Get the value of key and set its expiration.
- key
Key to get the value of
- expiredAt
The option which can modify command behavior. e.g. use
Expire.SetExpireAtSeconds
set the specified Unix time at which the key will expire in seconds- timestamp
an absolute Unix timestamp (seconds/milliseconds since January 1, 1970)
- returns
Returns the value of the string or None if it did not previously have a value.
- Definition Classes
- Strings
- final def getEx[K](key: K, expire: Expire, expireTime: zio.Duration)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get the value of key and set its expiration.
Get the value of key and set its expiration.
- key
Key to get the value of
- expire
The option which can modify command behavior. e.g. use
Expire.SetExpireSeconds
set the specified expire time in seconds- expireTime
Time in seconds/milliseconds until the string should expire
- returns
Returns the value of the string or None if it did not previously have a value.
- Definition Classes
- Strings
- final def getRange[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Get a substring of the string stored at key.
Get a substring of the string stored at key.
- key
Key of the string to get a substring of
- range
Range of the substring
- returns
Returns the substring.
- Definition Classes
- Strings
- final def getSet[K, V](key: K, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ResultBuilder1[Option]
Set the string value of a key and return its old value.
Set the string value of a key and return its old value.
- key
Key of string to set
- value
New value of the string
- returns
Returns the previous value of the string or None if it did not previously have a value.
- Definition Classes
- Strings
- final def hDel[K, F](key: K, field: F, fields: F*)(implicit arg0: Schema[K], arg1: Schema[F]): ZIO[Redis, RedisError, Long]
Removes the specified fields from the hash stored at
key
.Removes the specified fields from the hash stored at
key
.- key
of the hash that should be removed
- field
field to remove
- fields
additional fields
- returns
number of fields removed from the hash.
- Definition Classes
- Hashes
- final def hExists[K, F](key: K, field: F)(implicit arg0: Schema[K], arg1: Schema[F]): ZIO[Redis, RedisError, Boolean]
Returns if
field
is an existing field in the hash stored atkey
.Returns if
field
is an existing field in the hash stored atkey
.- key
of the hash that should be inspected
- field
field to inspect
- returns
true if the field exists, otherwise false.
- Definition Classes
- Hashes
- final def hGet[K, F](key: K, field: F)(implicit arg0: Schema[K], arg1: Schema[F]): ResultBuilder1[Option]
Returns the value associated with
field
in the hash stored atkey
.Returns the value associated with
field
in the hash stored atkey
.- key
of the hash whose field should be read
- field
which value should be returned
- returns
value stored in the field, if any.
- Definition Classes
- Hashes
- final def hGetAll[K](key: K)(implicit arg0: Schema[K]): ResultBuilder2[Map]
Returns all fields and values of the hash stored at
key
.Returns all fields and values of the hash stored at
key
.- key
of the hash that should be read
- returns
map of
field -> value
pairs under the key.
- Definition Classes
- Hashes
- final def hIncrBy[K, F](key: K, field: F, increment: Long)(implicit arg0: Schema[K], arg1: Schema[F]): ZIO[Redis, RedisError, Long]
Increments the number stored at
field
in the hash stored atkey
byincrement
.Increments the number stored at
field
in the hash stored atkey
byincrement
. If field does not exist the value is set toincrement
.- key
of the hash that should be updated
- field
field containing an integer, or a new field
- increment
integer to increment with
- returns
integer value after incrementing, or error if the field is not an integer.
- Definition Classes
- Hashes
- final def hIncrByFloat[K, F](key: K, field: F, increment: Double)(implicit arg0: Schema[K], arg1: Schema[F]): ZIO[Redis, RedisError, Double]
Increment the specified
field
of a hash stored atkey
, and representing a floating point number by the specifiedincrement
.Increment the specified
field
of a hash stored atkey
, and representing a floating point number by the specifiedincrement
.- key
of the hash that should be updated
- field
field containing a float, or a new field
- increment
float to increment with
- returns
float value after incrementing, or error if the field is not a float.
- Definition Classes
- Hashes
- final def hKeys[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Returns all field names in the hash stored at
key
.Returns all field names in the hash stored at
key
.- key
of the hash whose fields should be returned
- returns
chunk of field names.
- Definition Classes
- Hashes
- final def hLen[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Returns the number of fields contained in the hash stored at
key
.Returns the number of fields contained in the hash stored at
key
.- key
of the hash whose fields should be counted
- returns
number of fields.
- Definition Classes
- Hashes
- final def hRandField[K](key: K, count: Long, withValues: Boolean = false)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Returns an array of at most
count
distinct fields randomly.Returns an array of at most
count
distinct fields randomly. If called with a negativecount
, the command will return exactlycount
fields, allowing repeats. IfwithValues
is true it will return fields with his values intercalated.- key
of the hash which fields should be read
- count
maximum number of different fields to return if positive or the exact number, in absolute value if negative
- withValues
when true includes the respective values of the randomly selected hash fields
- returns
a list of fields or fields and values if
withValues
is true.
- Definition Classes
- Hashes
- final def hRandField[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Returns a random field from the hash value stored at
key
Returns a random field from the hash value stored at
key
- key
of the hash which fields should be read
- returns
random field in the hash or
None
whenkey
does not exist.
- Definition Classes
- Hashes
- final def hScan[K](key: K, cursor: Long, pattern: Option[String] = None, count: Option[Count] = None)(implicit arg0: Schema[K]): ResultBuilder2[[x, y](Long, Chunk[(x, y)])]
Iterates
fields
of Hash types and their associated values using a cursor-based iteratorIterates
fields
of Hash types and their associated values using a cursor-based iterator- key
of the hash that should be scanned
- cursor
integer representing iterator
- pattern
regular expression matching keys to scan
- count
approximate number of elements to return (see https://redis.io/commands/scan#the-count-option)
- returns
pair containing the next cursor and list of elements scanned.
- Definition Classes
- Hashes
- final def hSet[K, F, V](key: K, pair: (F, V), pairs: (F, V)*)(implicit arg0: Schema[K], arg1: Schema[F], arg2: Schema[V]): ZIO[Redis, RedisError, Long]
Sets
field -> value
pairs in the hash stored atkey
Sets
field -> value
pairs in the hash stored atkey
- key
of the hash whose value should be set
- pair
mapping of a field to value
- pairs
additional pairs
- returns
number of fields added.
- Definition Classes
- Hashes
- final def hSetNx[K, F, V](key: K, field: F, value: V)(implicit arg0: Schema[K], arg1: Schema[F], arg2: Schema[V]): ZIO[Redis, RedisError, Boolean]
Sets
field
in the hash stored atkey
tovalue
, only iffield
does not yet existSets
field
in the hash stored atkey
tovalue
, only iffield
does not yet exist- key
of the hash whose value should be set
- field
for which a value should be set
- value
that should be set
- returns
true if
field
is a new field and value was set, otherwise false.
- Definition Classes
- Hashes
- final def hStrLen[K, F](key: K, field: F)(implicit arg0: Schema[K], arg1: Schema[F]): ZIO[Redis, RedisError, Long]
Returns the string length of the value associated with
field
in the hash stored atkey
Returns the string length of the value associated with
field
in the hash stored atkey
- key
of the hash that should be read
- field
which value length should be returned
- returns
string length of the value in field, or zero if either field or key do not exist.
- Definition Classes
- Hashes
- final def hVals[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Returns all values in the hash stored at
key
Returns all values in the hash stored at
key
- key
of the hash which values should be read
- returns
list of values in the hash, or an empty list when
key
does not exist.
- Definition Classes
- Hashes
- final def hmGet[K, F](key: K, field: F, fields: F*)(implicit arg0: Schema[K], arg1: Schema[F]): ResultBuilder1[[x]Chunk[Option[x]]]
Returns the values associated with the specified
fields
in the hash stored atkey
.Returns the values associated with the specified
fields
in the hash stored atkey
.- key
of the hash whose values should be read
- field
fields to retrieve
- fields
additional fields
- returns
chunk of values, where value is
None
if the field is not in the hash.
- Definition Classes
- Hashes
- final def hmSet[K, F, V](key: K, pair: (F, V), pairs: (F, V)*)(implicit arg0: Schema[K], arg1: Schema[F], arg2: Schema[V]): ZIO[Redis, RedisError, Unit]
Sets the specified
field -> value
pairs in the hash stored atkey
.Sets the specified
field -> value
pairs in the hash stored atkey
. Deprecated: As per Redis 4.0.0, HMSET is considered deprecated. Please usehSet
instead.- key
of the hash whose value should be set
- pair
mapping of a field to value
- pairs
additional pairs
- returns
unit if fields are successfully set.
- Definition Classes
- Hashes
- final def incr[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Increment the integer value of a key by one.
Increment the integer value of a key by one.
- key
Key of the string to increment
- returns
Returns the value of key after the increment.
- Definition Classes
- Strings
- final def incrBy[K](key: K, increment: Long)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Increment the integer value of a key by the given amount.
Increment the integer value of a key by the given amount.
- key
Key of the value to increment
- increment
Amount to increment the value by
- returns
Returns the value of key after the increment.
- Definition Classes
- Strings
- final def incrByFloat[K](key: K, increment: Double)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Double]
Increment the float value of a key by the given amount.
Increment the float value of a key by the given amount.
- key
Key of the value to increment
- increment
Amount to increment the value by
- returns
Returns the value of key after the increment.
- Definition Classes
- Strings
- final def keys(pattern: String): ResultBuilder1[Chunk]
Returns all keys matching pattern.
Returns all keys matching pattern.
- pattern
string pattern
- returns
keys matching pattern.
- Definition Classes
- Keys
- final def lIndex[K](key: K, index: Long)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Returns the element at index in the list stored at key.
Returns the element at index in the list stored at key.
- key
they key identifier
- index
the requested index. It is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list
- returns
the requested element, or empty if the index is out of range.
- Definition Classes
- Lists
- final def lInsert[K, V](key: K, position: Position, pivot: V, element: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Inserts element in the list stored at key either before or after the reference value pivot.
Inserts element in the list stored at key either before or after the reference value pivot.
- key
the key identifier
- position
the position in which the element will be inserted
- pivot
the reference value
- element
the value to be inserted
- returns
the length of the list after the insert operation, or -1 when the value pivot was not found.
- Definition Classes
- Lists
- final def lLen[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Returns the length of the list stored at key.
Returns the length of the list stored at key.
- key
the key identifier. If key does not exist, it is interpreted as an empty list and 0 is returned
- returns
the length of the list at key.
- Definition Classes
- Lists
- final def lMove[S, D](source: S, destination: D, sourceSide: Side, destinationSide: Side)(implicit arg0: Schema[S], arg1: Schema[D]): ResultBuilder1[Option]
Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination.
Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination.
- source
the key where the element is removed
- destination
the key where the element is inserted
- sourceSide
the side where the element is removed
- destinationSide
the side where the element is inserted
- returns
the element which is moved or nil when the source is empty.
- Definition Classes
- Lists
- final def lPop[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Removes and returns the first element of the list stored at key.
Removes and returns the first element of the list stored at key.
- key
the key identifier
- returns
the value of the first element, or empty when key does not exist.
- Definition Classes
- Lists
- final def lPos[K, V](key: K, element: V, rank: Option[Rank] = None, maxLen: Option[ListMaxLen] = None)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Option[Long]]
The command returns the index of matching elements inside a Redis list.
The command returns the index of matching elements inside a Redis list. By default, when no options are given, it will scan the list from head to tail, looking for the first match of "element". If the element is found, its index (the zero-based position in the list) is returned. Otherwise, if no match is found, NULL is returned.
- key
the key identifier
- element
the element to search for
- rank
the rank of the element
- maxLen
limit the number of performed comparisons
- returns
Either an integer or an array depending on the count option.
- Definition Classes
- Lists
- final def lPosCount[K, V](key: K, element: V, count: Count, rank: Option[Rank] = None, maxLen: Option[ListMaxLen] = None)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Chunk[Long]]
The command returns the index of matching elements inside a Redis list.
The command returns the index of matching elements inside a Redis list. By default, when no options are given, it will scan the list from head to tail, looking for the first match of "element". If the element is found, its index (the zero-based position in the list) is returned. Otherwise, if no match is found, NULL is returned.
- key
the key identifier
- element
the element to search for
- count
return up count element indexes
- rank
the rank of the element
- maxLen
limit the number of performed comparisons
- returns
Either an integer or an array depending on the count option.
- Definition Classes
- Lists
- final def lPush[K, V](key: K, element: V, elements: V*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Prepends one or multiple elements to the list stored at key.
Prepends one or multiple elements to the list stored at key. If key does not exist, it is created as empty list before performing the push operations.
- key
the key identifier
- element
the first element to prepend
- elements
the rest of elements to prepend
- returns
the length of the list after the push operation.
- Definition Classes
- Lists
- final def lPushX[K, V](key: K, element: V, elements: V*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Prepends an element to a list, only if the list exists.
Prepends an element to a list, only if the list exists. In contrary to zio.redis.api.Lists#lPush, no operation will be performed when key does not yet exist.
- key
the key identifier
- element
the first element to prepend
- elements
the rest of elements to prepends
- returns
the length of the list after the push operation.
- Definition Classes
- Lists
- final def lRange[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Gets a range of elements from the list stored at key.
Gets a range of elements from the list stored at key.
- key
the key identifier
- range
the range of elements to retrieve. The range should be zero-based, with 0 being the first element of the list (the head of the list), 1 being the next element and so on
- returns
a chunk of elements in the specified range.
- Definition Classes
- Lists
- final def lRem[K](key: K, count: Long, element: String)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Removes the first count occurrences of element from the list stored at key.
Removes the first count occurrences of element from the list stored at key. The count argument influences the operation in the following ways:
- count > 0: Remove elements equal to element moving from head to tail.
- count < 0: Remove elements equal to element moving from tail to head.
- count = 0: Remove all elements equal to element.
- key
the key identifier. Non-existing keys are treated like empty lists, so when key does not exist, the command will always return 0
- count
the number of elements to remove
- element
the element to be removed
- returns
the number of removed elements.
- Definition Classes
- Lists
- final def lSet[K, V](key: K, index: Long, element: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Unit]
Sets the list element at index to element.
Sets the list element at index to element.
- key
the key identifier
- index
the requested index. The index is zero-based, so 0 means the first element, 1 the second element and so on
- element
the value to be inserted
- returns
the Unit value.
- Definition Classes
- Lists
- final def lTrim[K](key: K, range: Range)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Unit]
Trims an existing list so that it will contain only the specified range of elements.
Trims an existing list so that it will contain only the specified range of elements.
- key
the key identifier
- range
the range of elements to trim. The range should be zero-based, with 0 being the first element of the list (the head of the list), 1 being the next element and so on
- returns
the Unit value.
- Definition Classes
- Lists
- final def mGet[K](key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[[x]Chunk[Option[x]]]
Get all the values of the given keys.
Get all the values of the given keys.
- key
First key to get
- keys
Subsequent keys to get
- returns
Returns the values of the given keys.
- Definition Classes
- Strings
- final def mSet[K, V](keyValue: (K, V), keyValues: (K, V)*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Unit]
Set multiple keys to multiple values.
Set multiple keys to multiple values.
- keyValue
Tuple of key and value, first one to set
- keyValues
Subsequent tuples of key values
- Definition Classes
- Strings
- final def mSetNx[K, V](keyValue: (K, V), keyValues: (K, V)*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Boolean]
Set multiple keys to multiple values only if none of the keys exist.
Set multiple keys to multiple values only if none of the keys exist.
- keyValue
First key value to set
- keyValues
Subsequent key values to set
- returns
1 if the all the keys were set. 0 if no key was set (at least one key already existed).
- Definition Classes
- Strings
- final def migrate[K](host: String, port: Long, key: K, destinationDb: Long, timeout: zio.Duration, auth: Option[Auth] = None, copy: Option[Copy] = None, replace: Option[Replace] = None, keys: Option[(K, List[K])])(implicit arg0: Schema[K]): ZIO[Redis, RedisError, String]
Atomically transfer a key from a source Redis instance to a destination Redis instance.
Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is deleted from the original instance and is guaranteed to exist in the target instance.
- host
remote redis host
- port
remote redis instance port
- key
key to be transferred or empty string if using the keys option
- destinationDb
remote database id
- timeout
specifies the longest period without blocking which is allowed during the transfer
- auth
optionally provide password for the remote instance
- copy
copy option, to not remove the key from the local instance
- replace
replace option, to replace existing key on the remote instance
- keys
keys option, to migrate multiple keys, non empty list of keys
- returns
string OK on success, or NOKEY if no keys were found in the source instance.
- Definition Classes
- Keys
- final def move[K](key: K, destinationDb: Long)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Move key from the currently selected database to the specified destination database.
Move key from the currently selected database to the specified destination database. When key already exists in the destination database, or it does not exist in the source database, it does nothing.
- key
key
- destinationDb
destination database id
- returns
true if the key was moved.
- Definition Classes
- Keys
- final def pExpire[K](key: K, timeout: zio.Duration)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Set a timeout on key.
- final def pExpireAt[K](key: K, timestamp: Instant)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Deletes the key at the specific timestamp.
- final def pSetEx[K, V](key: K, milliseconds: zio.Duration, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Unit]
Set the value and expiration in milliseconds of a key.
Set the value and expiration in milliseconds of a key.
- key
Key of the string to set the expiry time on
- milliseconds
Time in milliseconds until the string should expire
- value
Value to set
- Definition Classes
- Strings
- final def pTtl[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, zio.Duration]
Returns the remaining time to live of a key that has a timeout.
Returns the remaining time to live of a key that has a timeout.
- key
key
- returns
remaining time to live of a key that has a timeout, error otherwise.
- Definition Classes
- Keys
- final def persist[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Remove the existing timeout on key.
Remove the existing timeout on key.
- key
key
- returns
true if timeout was removed, false if key does not exist or does not have an associated timeout.
- Definition Classes
- Keys
- final def pfAdd[K, V](key: K, element: V, elements: V*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Boolean]
Adds the specified elements to the specified HyperLogLog.
Adds the specified elements to the specified HyperLogLog.
- key
HLL key where the elements will be added
- element
element to count
- elements
additional elements to count
- returns
boolean indicating if at least 1 HyperLogLog register was altered.
- Definition Classes
- HyperLogLog
- final def pfCount[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
- key
HLL key
- keys
additional keys
- returns
approximate number of unique elements observed via PFADD.
- Definition Classes
- HyperLogLog
- final def pfMerge[K](destKey: K, sourceKey: K, sourceKeys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Unit]
Merge N different HyperLogLogs into a single one.
Merge N different HyperLogLogs into a single one.
- destKey
HLL key where the merged HLLs will be stored
- sourceKey
HLL key to merge
- sourceKeys
additional keys to merge
- Definition Classes
- HyperLogLog
- final def ping(message: Option[String] = None): ZIO[Redis, RedisError, String]
Pings the server.
Pings the server.
- message
the optional message to receive back from server
- returns
PONG if no argument is provided, otherwise return a copy of the argument as a bulk. This command is often used to test if a connection is still alive, or to measure latency.
- Definition Classes
- Connection
- final def quit: ZIO[Redis, RedisError, Unit]
Ask the server to close the connection.
Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client
- returns
the Unit value.
- Definition Classes
- Connection
- final def rPop[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Removes and returns the last element in the list stored at key.
Removes and returns the last element in the list stored at key.
- key
the key identifier
- returns
the value of the last element, or empty when key does not exist.
- Definition Classes
- Lists
- final def rPopLPush[S, D](source: S, destination: D)(implicit arg0: Schema[S], arg1: Schema[D]): ResultBuilder1[Option]
Atomically removes the last element in the list stored at source, prepends it to the list stored at destination and returns it.
Atomically removes the last element in the list stored at source, prepends it to the list stored at destination and returns it. If source and destination are the same, the operation is equivalent to removing the last element from the list and pushing it as first element of the same list, so it can be considered as a list rotation command.
- source
the key identifier of the source list
- destination
the key identifier of the destination list
- returns
the element being popped and pushed. If source does not exist, empty is returned and no operation is performed.
- Definition Classes
- Lists
- final def rPush[K, V](key: K, element: V, elements: V*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Appends one or more elements to the list stored at key.
Appends one or more elements to the list stored at key. If key does not exist, it is created as empty list before performing the push operation.
- key
the key identifier
- element
the first element to append
- elements
the rest of elements to append
- returns
the length of the list after the push operation.
- Definition Classes
- Lists
- final def rPushX[K, V](key: K, element: V, elements: V*)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Appends on or multiple elements to the list stored at key, only if the list exists.
Appends on or multiple elements to the list stored at key, only if the list exists. In contrary to zio.redis.api.Lists#rPush, no operation will be performed when key does not yet exist.
- key
the key identifier
- element
the first element to append
- elements
the rest of elements to append
- returns
the length of the list after the push operation.
- Definition Classes
- Lists
- final def randomKey: ResultBuilder1[Option]
Return a random key from the currently selected database.
Return a random key from the currently selected database.
- returns
key or None when the database is empty.
- Definition Classes
- Keys
- final def rename[K](key: K, newKey: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Unit]
Renames key to newKey.
Renames key to newKey. It returns an error when key does not exist. If newKey already exists it is overwritten.
- key
key to be renamed
- newKey
new name
- returns
unit if successful, error otherwise.
- Definition Classes
- Keys
- final def renameNx[K](key: K, newKey: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Renames key to newKey if newKey does not yet exist.
Renames key to newKey if newKey does not yet exist. It returns an error when key does not exist.
- key
key to be renamed
- newKey
new name
- returns
true if key was renamed to newKey, false if newKey already exists.
- Definition Classes
- Keys
- final def reset: ZIO[Redis, RedisError, Unit]
Performs a full reset of the connection's server-side context, mimicking the effects of disconnecting and reconnecting again
Performs a full reset of the connection's server-side context, mimicking the effects of disconnecting and reconnecting again
- returns
the Unit value.
- Definition Classes
- Connection
- final def restore[K](key: K, ttl: Long, value: Chunk[Byte], replace: Option[Replace] = None, absTtl: Option[AbsTtl] = None, idleTime: Option[IdleTime] = None, freq: Option[Freq] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Unit]
Create a key associated with a value that is obtained by deserializing the provided serialized value.
Create a key associated with a value that is obtained by deserializing the provided serialized value. Error when key already exists unless you use the REPLACE option.
- key
key
- ttl
time to live in milliseconds, 0 if without any expire
- value
serialized value
- replace
replace option, replace if existing
- absTtl
absolute ttl option, ttl should represent an absolute Unix timestamp (in milliseconds) in which the key will expire
- idleTime
idle time based eviction policy
- freq
frequency based eviction policy
- returns
unit on success.
- Definition Classes
- Keys
- final def sAdd[K, M](key: K, member: M, members: M*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Add one or more members to a set.
Add one or more members to a set.
- key
Key of set to add to
- member
first member to add
- members
subsequent members to add
- returns
Returns the number of elements that were added to the set, not including all the elements already present into the set.
- Definition Classes
- Sets
- final def sCard[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Get the number of members in a set.
Get the number of members in a set.
- key
Key of set to get the number of members of
- returns
Returns the cardinality (number of elements) of the set, or 0 if key does not exist.
- Definition Classes
- Sets
- final def sDiff[K](key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Subtract multiple sets.
Subtract multiple sets.
- key
Key of the set to subtract from
- keys
Keys of the sets to subtract
- returns
Returns the members of the set resulting from the difference between the first set and all the successive sets.
- Definition Classes
- Sets
- final def sDiffStore[D, K](destination: D, key: K, keys: K*)(implicit arg0: Schema[D], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Subtract multiple sets and store the resulting set in a key.
Subtract multiple sets and store the resulting set in a key.
- destination
Key of set to store the resulting set
- key
Key of set to be subtracted from
- keys
Keys of sets to subtract
- returns
Returns the number of elements in the resulting set.
- Definition Classes
- Sets
- final def sInter[K](destination: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Intersect multiple sets and store the resulting set in a key.
Intersect multiple sets and store the resulting set in a key.
- destination
Key of set to store the resulting set
- keys
Keys of the sets to intersect with each other
- returns
Returns the members of the set resulting from the intersection of all the given sets.
- Definition Classes
- Sets
- final def sInterStore[D, K](destination: D, key: K, keys: K*)(implicit arg0: Schema[D], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Intersect multiple sets and store the resulting set in a key.
Intersect multiple sets and store the resulting set in a key.
- destination
Key of set to store the resulting set
- key
Key of first set to intersect
- keys
Keys of subsequent sets to intersect
- returns
Returns the number of elements in the resulting set.
- Definition Classes
- Sets
- final def sIsMember[K, M](key: K, member: M)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Boolean]
Determine if a given value is a member of a set.
Determine if a given value is a member of a set.
- key
of the set
- member
value which should be searched in the set
- returns
Returns 1 if the element is a member of the set. 0 if the element is not a member of the set, or if key does not exist.
- Definition Classes
- Sets
- final def sMembers[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Get all the members in a set.
Get all the members in a set.
- key
Key of the set to get the members of
- returns
Returns the members of the set.
- Definition Classes
- Sets
- final def sMove[S, D, M](source: S, destination: D, member: M)(implicit arg0: Schema[S], arg1: Schema[D], arg2: Schema[M]): ZIO[Redis, RedisError, Boolean]
Move a member from one set to another.
Move a member from one set to another.
- source
Key of the set to move the member from
- destination
Key of the set to move the member to
- member
Element to move
- returns
Returns 1 if the element was moved. 0 if it was not found.
- Definition Classes
- Sets
- final def sPop[K](key: K, count: Option[Long] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Remove and return one or multiple random members from a set.
Remove and return one or multiple random members from a set.
- key
Key of the set to remove items from
- count
Number of elements to remove
- returns
Returns the elements removed.
- Definition Classes
- Sets
- final def sRandMember[K](key: K, count: Option[Long] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Get one or multiple random members from a set.
Get one or multiple random members from a set.
- key
Key of the set to get members from
- count
Number of elements to randomly get
- returns
Returns the random members.
- Definition Classes
- Sets
- final def sRem[K, M](key: K, member: M, members: M*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Remove one of more members from a set.
Remove one of more members from a set.
- key
Key of the set to remove members from
- member
Value of the first element to remove
- members
Subsequent values of elements to remove
- returns
Returns the number of members that were removed from the set, not including non existing members.
- Definition Classes
- Sets
- final def sScan[K](key: K, cursor: Long, pattern: Option[String] = None, count: Option[Count] = None)(implicit arg0: Schema[K]): ResultBuilder1[[x](Long, Chunk[x])]
Incrementally iterate Set elements.
Incrementally iterate Set elements.
This is a cursor based scan of an entire set. Call initially with cursor set to 0 and on subsequent calls pass the return value as the next cursor.
- key
Key of the set to scan
- cursor
Cursor to use for this iteration of scan
- pattern
Glob-style pattern that filters which elements are returned
- count
Count of elements. Roughly this number will be returned by Redis if possible
- returns
Returns the next cursor, and items for this iteration or nothing when you reach the end, as a tuple.
- Definition Classes
- Sets
- final def sUnion[K](key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Add multiple sets.
Add multiple sets.
- key
Key of the first set to add
- keys
Keys of the subsequent sets to add
- returns
Returns a list with members of the resulting set.
- Definition Classes
- Sets
- final def sUnionStore[D, K](destination: D, key: K, keys: K*)(implicit arg0: Schema[D], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Add multiple sets and add the resulting set in a key.
Add multiple sets and add the resulting set in a key.
- destination
Key of destination to store the result
- key
Key of first set to add
- keys
Subsequent keys of sets to add
- returns
Returns the number of elements in the resulting set.
- Definition Classes
- Sets
- final def scan(cursor: Long, pattern: Option[String] = None, count: Option[Count] = None, type: Option[RedisType] = None): ResultBuilder1[[x](Long, Chunk[x])]
Iterates the set of keys in the currently selected Redis database.
Iterates the set of keys in the currently selected Redis database. An iteration starts when the cursor is set to 0, and terminates when the cursor returned by the server is 0.
- cursor
cursor value, starts with zero
- pattern
key pattern
- count
count option, specifies number of returned elements per call
- returns
returns an updated cursor that the user needs to use as the cursor argument in the next call along with the values.
- Definition Classes
- Keys
- def scriptExists(sha1: String, sha1s: String*): ZIO[Redis, RedisError, Chunk[Boolean]]
Checks existence of the scripts in the script cache.
Checks existence of the scripts in the script cache.
- sha1
one required SHA1 digest
- sha1s
maybe rest of the SHA1 digests
- returns
for every corresponding SHA1 digest of a script that actually exists in the script cache, an true is returned, otherwise false is returned.
- Definition Classes
- Scripting
- def scriptLoad(script: String): ZIO[Redis, RedisError, String]
Loads a script into the scripts cache.
Loads a script into the scripts cache. After the script is loaded into the script cache it could be evaluated using the zio.redis.api.Scripting.evalSha method.
- script
Lua script
- returns
the SHA1 digest of the script added into the script cache.
- Definition Classes
- Scripting
- final def select(index: Long): ZIO[Redis, RedisError, Unit]
Changes the database for the current connection to the database having the specified numeric index.
Changes the database for the current connection to the database having the specified numeric index. The currently selected database is a property of the connection; clients should track the selected database and re-select it on reconnection.
- index
the database index. The index is zero-based. New connections always use the database 0
- returns
the Unit value.
- Definition Classes
- Connection
- final def set[K, V](key: K, value: V, expireTime: Option[zio.Duration] = None, update: Option[Update] = None, keepTtl: Option[KeepTtl] = None)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Boolean]
Set the string value of a key.
Set the string value of a key.
- key
Key of the string to set
- value
Value to set
- expireTime
Time until the string expires
- update
Update can be Update.SetExisting which only sets the key if it exists, or Update.SetNew which nly sets the key if it does not exist
- keepTtl
When set any previously set expire time remains unchanged
- returns
true if set was executed correctly, false otherwise.
- Definition Classes
- Strings
- final def setBit[K](key: K, offset: Long, value: Boolean)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Boolean]
Sets or clears the bit at offset in the string value stored at key.
Sets or clears the bit at offset in the string value stored at key.
- key
Key of the string to set or clear bits
- offset
Offset at which to set or clear the bit
- value
True if bit should be set, False if it should be cleared
- returns
Returns the original bit value stored at offset.
- Definition Classes
- Strings
- final def setEx[K, V](key: K, expiration: zio.Duration, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Unit]
Set the value and expiration of a key.
Set the value and expiration of a key.
- key
Key of the value to update
- expiration
Expiration time for the value
- value
New value to set
- Definition Classes
- Strings
- final def setNx[K, V](key: K, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Boolean]
Set the value of a key, only if the key does not exist.
Set the value of a key, only if the key does not exist.
- key
Key of the value to set if the key does not exist
- value
Value to set
- returns
Returns 1 if the key was set. 0 if the key was not set.
- Definition Classes
- Strings
- final def setRange[K, V](key: K, offset: Long, value: V)(implicit arg0: Schema[K], arg1: Schema[V]): ZIO[Redis, RedisError, Long]
Overwrite part of a string at key starting at the specified offset.
Overwrite part of a string at key starting at the specified offset.
- key
Key of the string to overwite
- offset
Offset to start writing
- value
Value to overwrite with
- returns
Returns the length of the string after it was modified by the command.
- Definition Classes
- Strings
- final def sort[K](key: K, by: Option[String] = None, limit: Option[Limit] = None, order: Order = Order.Ascending, get: Option[(String, List[String])] = None, alpha: Option[Alpha] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Sorts the list, set, or sorted set stored at key.
Sorts the list, set, or sorted set stored at key. Returns the sorted elements.
- key
key
- by
by option, specifies a pattern to use as an external key
- limit
limit option, take only limit values, starting at position offset
- order
ordering option, sort descending instead of ascending
- get
get option, return the values referenced by the keys generated from the get patterns
- alpha
alpha option, sort the values alphanumerically, instead of by interpreting the value as floating point number
- returns
the sorted values, or the values found using the get patterns.
- Definition Classes
- Keys
- final def sortStore[K](key: K, storeAt: Store, by: Option[String] = None, limit: Option[Limit] = None, order: Order = Order.Ascending, get: Option[(String, List[String])] = None, alpha: Option[Alpha] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Sorts the list, set, or sorted set stored at key.
Sorts the list, set, or sorted set stored at key. Stores the results at storeAt. Returns the number of values sorted.
The functions sort and sortStore are both implemented by the Redis command SORT. Because they have different return types, they are split into two Scala functions.
- key
key
- storeAt
where to store the results
- by
by option, specifies a pattern to use as an external key
- limit
limit option, take only limit values, starting at position offset
- order
ordering option, sort descending instead of ascending
- get
get option, return the values referenced by the keys generated from the get patterns
- alpha
alpha option, sort the values alphanumerically, instead of by interpreting the value as floating point number
- returns
the sorted values, or the values found using the get patterns.
- Definition Classes
- Keys
- final def strLen[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Get the length of a value stored in a key.
Get the length of a value stored in a key.
- key
Key of the string to get the length of
- returns
Returns the length of the string.
- Definition Classes
- Strings
- final def stralgoLcs[K](command: StrAlgoLCS, keyA: K, keyB: K, lcsQueryType: Option[StrAlgoLcsQueryType] = None)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, LcsOutput]
Get the longest common subsequence of values stored in the given keys.
Get the longest common subsequence of values stored in the given keys.
- command
type of value it (possible values are Strings and Keys)
- keyA
first value that will contain subsequence
- keyB
second value that will contain subsequence
- lcsQueryType
modifier that will affect the output
- returns
Without modifiers returns the string representing the longest common substring. When LEN is given the command returns the length of the longest common substring. When IDX is given the command returns an array with the LCS length and all the ranges in both the strings, start and end offset for each string, where there are matches. When withMatchLen is given each array representing a match will also have the length of the match (see examples).
- Definition Classes
- Strings
- final def touch[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Alters the last access time of a key(s).
Alters the last access time of a key(s). A key is ignored if it does not exist.
- key
one required key
- keys
maybe rest of the keys
- returns
The number of keys that were touched.
- Definition Classes
- Keys
- final def ttl[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, zio.Duration]
Returns the remaining time to live of a key that has a timeout.
Returns the remaining time to live of a key that has a timeout.
- key
key
- returns
remaining time to live of a key that has a timeout, error otherwise.
- Definition Classes
- Keys
- final def typeOf[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, RedisType]
Returns the string representation of the type of the value stored at key.
Returns the string representation of the type of the value stored at key.
- key
key
- returns
type of the value stored at key.
- Definition Classes
- Keys
- final def unlink[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Removes the specified keys.
- final def wait_(replicas: Long, timeout: zio.Duration): ZIO[Redis, RedisError, Long]
This command blocks the current client until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas.
This command blocks the current client until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas.
- replicas
minimum replicas to reach
- timeout
specified as a Duration, 0 means to block forever
- returns
the number of replicas reached both in case of failure and success.
- Definition Classes
- Keys
- final def xAck[SK, G, I](key: SK, group: G, id: I, ids: I*)(implicit arg0: Schema[SK], arg1: Schema[G], arg2: Schema[I]): ZIO[Redis, RedisError, Long]
Removes one or multiple messages from the pending entries list (PEL) of a stream consumer group.
Removes one or multiple messages from the pending entries list (PEL) of a stream consumer group.
- key
ID of the stream
- group
ID of the consumer group
- id
ID of the message
- ids
IDs of the rest of the messages
- returns
the number of messages successfully acknowledged.
- Definition Classes
- Streams
- final def xAdd[SK, I, K, V](key: SK, id: I, pair: (K, V), pairs: (K, V)*)(implicit arg0: Schema[SK], arg1: Schema[I], arg2: Schema[K], arg3: Schema[V]): ResultBuilder1[Id]
Appends the specified stream entry to the stream at the specified key.
Appends the specified stream entry to the stream at the specified key.
- key
ID of the stream
- id
ID of the message
- pair
field and value pair
- pairs
rest of the field and value pairs
- returns
ID of the added entry.
- Definition Classes
- Streams
- final def xAddWithMaxLen[SK, I, K, V](key: SK, id: I, count: Long, approximate: Boolean = false)(pair: (K, V), pairs: (K, V)*)(implicit arg0: Schema[SK], arg1: Schema[I], arg2: Schema[K], arg3: Schema[V]): ResultBuilder1[Id]
Appends the specified stream entry to the stream at the specified key while limiting the size of the stream.
Appends the specified stream entry to the stream at the specified key while limiting the size of the stream.
- key
ID of the stream
- id
ID of the message
- count
maximum number of elements in a stream
- approximate
flag that indicates if a stream should be limited to the exact number of elements
- pair
field and value pair
- pairs
rest of the field and value pairs
- returns
ID of the added entry.
- Definition Classes
- Streams
- final def xClaim[SK, SG, SC, I](key: SK, group: SG, consumer: SC, minIdleTime: zio.Duration, idle: Option[zio.Duration] = None, time: Option[zio.Duration] = None, retryCount: Option[Long] = None, force: Boolean = false)(id: I, ids: I*)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[SC], arg3: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamEntry[I, x, y]]]
Changes the ownership of a pending message.
Changes the ownership of a pending message.
- key
ID of the stream
- group
ID of the consumer group
- consumer
ID of the consumer
- minIdleTime
minimum idle time of a message
- idle
idle time (last time it was delivered) of the message that will be set
- time
same as idle but instead of a relative amount of milliseconds, it sets the idle time to a specific Unix time (in milliseconds)
- retryCount
retry counter of a message that will be set
- force
flag that indicates that a message doesn't have to be in a pending entries list (PEL)
- id
ID of a message
- ids
IDs of the rest of the messages
- returns
messages successfully claimed.
- Definition Classes
- Streams
- final def xClaimWithJustId[SK, SG, SC, I](key: SK, group: SG, consumer: SC, minIdleTime: zio.Duration, idle: Option[zio.Duration] = None, time: Option[zio.Duration] = None, retryCount: Option[Long] = None, force: Boolean = false)(id: I, ids: I*)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[SC], arg3: Schema[I]): ResultBuilder1[Chunk]
Changes the ownership of a pending message.
Changes the ownership of a pending message.
- key
ID of the stream
- group
ID of the consumer group
- consumer
ID of the consumer
- minIdleTime
minimum idle time of a message
- idle
idle time (last time it was delivered) of the message that will be set
- time
same as idle but instead of a relative amount of milliseconds, it sets the idle time to a specific Unix time (in milliseconds)
- retryCount
retry counter of a message that will be set
- force
flag that indicates that a message doesn't have to be in a pending entries list (PEL)
- id
ID of a message
- ids
IDs of the rest of the messages
- returns
IDs of the messages that are successfully claimed.
- Definition Classes
- Streams
- final def xDel[SK, I](key: SK, id: I, ids: I*)(implicit arg0: Schema[SK], arg1: Schema[I]): ZIO[Redis, RedisError, Long]
Removes the specified entries from a stream.
Removes the specified entries from a stream.
- key
ID of the stream
- id
ID of the message
- ids
IDs of the rest of the messages
- returns
the number of entries deleted.
- Definition Classes
- Streams
- final def xGroupCreate[SK, SG, I](key: SK, group: SG, id: I, mkStream: Boolean = false)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[I]): ZIO[Redis, RedisError, Unit]
Create a new consumer group associated with a stream.
Create a new consumer group associated with a stream.
- key
ID of the stream
- group
ID of the consumer group
- id
ID of the last item in the stream to consider already delivered
- mkStream
ID of the last item in the stream to consider already delivered
- Definition Classes
- Streams
- final def xGroupCreateConsumer[SK, SG, SC](key: SK, group: SG, consumer: SC)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[SC]): ZIO[Redis, RedisError, Boolean]
Create a new consumer associated with a consumer group.
Create a new consumer associated with a consumer group.
- key
ID of the stream
- group
ID of the consumer group
- consumer
ID of the consumer
- returns
the number of created consumer groups.
- Definition Classes
- Streams
- final def xGroupDelConsumer[SK, SG, SC](key: SK, group: SG, consumer: SC)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[SC]): ZIO[Redis, RedisError, Long]
Remove a specific consumer from a consumer group.
Remove a specific consumer from a consumer group.
- key
ID of the stream
- group
ID of the consumer group
- consumer
ID of the consumer
- returns
the number of pending messages that the consumer had before it was deleted.
- Definition Classes
- Streams
- final def xGroupDestroy[SK, SG](key: SK, group: SG)(implicit arg0: Schema[SK], arg1: Schema[SG]): ZIO[Redis, RedisError, Boolean]
Destroy a consumer group.
Destroy a consumer group.
- key
ID of the stream
- group
ID of the consumer group
- returns
flag that indicates if the deletion was successful.
- Definition Classes
- Streams
- final def xGroupSetId[SK, SG, I](key: SK, group: SG, id: I)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[I]): ZIO[Redis, RedisError, Unit]
Set the consumer group last delivered ID to something else.
Set the consumer group last delivered ID to something else.
- key
ID of the stream
- group
ID of the consumer group
- id
last delivered ID to set
- Definition Classes
- Streams
- final def xInfoConsumers[SK, SG](key: SK, group: SG)(implicit arg0: Schema[SK], arg1: Schema[SG]): ZIO[Redis, RedisError, Chunk[StreamConsumersInfo]]
An introspection command used in order to retrieve different information about the consumers.
An introspection command used in order to retrieve different information about the consumers.
- key
ID of the stream
- group
ID of the consumer group
- returns
List of every consumer in a specific consumer group.
- Definition Classes
- Streams
- final def xInfoGroups[SK](key: SK)(implicit arg0: Schema[SK]): ZIO[Redis, RedisError, Chunk[StreamGroupsInfo]]
An introspection command used in order to retrieve different information about the group.
An introspection command used in order to retrieve different information about the group.
- key
ID of the stream
- returns
List of consumer groups associated with the stream stored at the specified key.
- Definition Classes
- Streams
- final def xInfoStream[SK](key: SK)(implicit arg0: Schema[SK]): ResultBuilder3[StreamInfo]
An introspection command used in order to retrieve different information about the stream.
An introspection command used in order to retrieve different information about the stream.
- key
ID of the stream
- returns
General information about the stream stored at the specified key.
- Definition Classes
- Streams
- final def xInfoStreamFull[SK](key: SK, count: Long)(implicit arg0: Schema[SK]): ResultBuilder3[FullStreamInfo]
Returns the entire state of the stream, including entries, groups, consumers and PELs.
Returns the entire state of the stream, including entries, groups, consumers and PELs.
- key
ID of the stream
- count
limit the amount of stream/PEL entries that are returned (The first <count> entries are returned)
- returns
General information about the stream stored at the specified key.
- Definition Classes
- Streams
- final def xInfoStreamFull[SK](key: SK)(implicit arg0: Schema[SK]): ResultBuilder3[FullStreamInfo]
Returns the entire state of the stream, including entries, groups, consumers and PELs.
Returns the entire state of the stream, including entries, groups, consumers and PELs.
- key
ID of the stream
- returns
General information about the stream stored at the specified key.
- Definition Classes
- Streams
- final def xLen[SK](key: SK)(implicit arg0: Schema[SK]): ZIO[Redis, RedisError, Long]
Fetches the number of entries inside a stream.
Fetches the number of entries inside a stream.
- key
ID of the stream
- returns
the number of entries inside a stream.
- Definition Classes
- Streams
- final def xPending[SK, SG, I, SC](key: SK, group: SG, start: I, end: I, count: Long, consumer: Option[SC] = None, idle: Option[zio.Duration] = None)(implicit arg0: Schema[SK], arg1: Schema[SG], arg2: Schema[I], arg3: Schema[SC]): ZIO[Redis, RedisError, Chunk[PendingMessage]]
Inspects the list of pending messages.
Inspects the list of pending messages.
- key
ID of the stream
- group
ID of the consumer group
- start
start of the range of IDs
- end
end of the range of IDs
- count
maximum number of messages returned
- consumer
ID of the consumer
- idle
idle time of a pending message by which message are filtered
- returns
detailed information for each message in the pending entries list.
- Definition Classes
- Streams
- final def xPending[SK, SG](key: SK, group: SG)(implicit arg0: Schema[SK], arg1: Schema[SG]): ZIO[Redis, RedisError, PendingInfo]
Inspects the list of pending messages.
Inspects the list of pending messages.
- key
ID of the stream
- group
ID of the consumer group
- returns
summary about the pending messages in a given consumer group.
- Definition Classes
- Streams
- final def xRange[SK, I](key: SK, start: I, end: I, count: Long)(implicit arg0: Schema[SK], arg1: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamEntry[I, x, y]]]
Fetches the stream entries matching a given range of IDs.
Fetches the stream entries matching a given range of IDs.
- key
ID of the stream
- start
start of the range of IDs
- end
end of the range of IDs
- count
maximum number of entries returned
- returns
the complete entries with IDs matching the specified range.
- Definition Classes
- Streams
- final def xRange[SK, I](key: SK, start: I, end: I)(implicit arg0: Schema[SK], arg1: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamEntry[I, x, y]]]
Fetches the stream entries matching a given range of IDs.
Fetches the stream entries matching a given range of IDs.
- key
ID of the stream
- start
start of the range of IDs
- end
end of the range of IDs
- returns
the complete entries with IDs matching the specified range.
- Definition Classes
- Streams
- final def xRead[SK, I](count: Option[Long] = None, block: Option[zio.Duration] = None)(stream: (SK, I), streams: (SK, I)*)(implicit arg0: Schema[SK], arg1: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamChunk[SK, I, x, y]]]
Read data from one or multiple streams.
Read data from one or multiple streams.
- count
maximum number of elements returned per stream
- block
duration for which we want to block before timing out
- stream
pair that contains stream ID and the last ID that the consumer received for that stream
- streams
rest of the pairs
- returns
complete entries with an ID greater than the last received ID per stream.
- Definition Classes
- Streams
- final def xReadGroup[SG, SC, SK, I](group: SG, consumer: SC, count: Option[Long] = None, block: Option[zio.Duration] = None, noAck: Boolean = false)(stream: (SK, I), streams: (SK, I)*)(implicit arg0: Schema[SG], arg1: Schema[SC], arg2: Schema[SK], arg3: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamChunk[SK, I, x, y]]]
Read data from one or multiple streams using consumer group.
Read data from one or multiple streams using consumer group.
- group
ID of the consumer group
- consumer
ID of the consumer
- count
maximum number of elements returned per stream
- block
duration for which we want to block before timing out
- noAck
flag that indicates that the read messages shouldn't be added to the pending entries list (PEL)
- stream
pair that contains stream ID and the last ID that the consumer received for that stream
- streams
rest of the pairs
- returns
complete entries with an ID greater than the last received ID per stream.
- Definition Classes
- Streams
- final def xRevRange[SK, I](key: SK, end: I, start: I, count: Long)(implicit arg0: Schema[SK], arg1: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamEntry[I, x, y]]]
Fetches the stream entries matching a given range of IDs in the reverse order.
Fetches the stream entries matching a given range of IDs in the reverse order.
- key
ID of the stream
- end
end of the range of IDs
- start
start of the range of IDs
- count
maximum number of entries returned
- returns
the complete entries with IDs matching the specified range in the reverse order.
- Definition Classes
- Streams
- final def xRevRange[SK, I](key: SK, end: I, start: I)(implicit arg0: Schema[SK], arg1: Schema[I]): ResultBuilder2[[x, y]Chunk[StreamEntry[I, x, y]]]
Fetches the stream entries matching a given range of IDs in the reverse order.
Fetches the stream entries matching a given range of IDs in the reverse order.
- key
ID of the stream
- end
end of the range of IDs
- start
start of the range of IDs
- returns
the complete entries with IDs matching the specified range in the reverse order.
- Definition Classes
- Streams
- final def xTrim[SK](key: SK, count: Long, approximate: Boolean = false)(implicit arg0: Schema[SK]): ZIO[Redis, RedisError, Long]
Trims the stream to a given number of items, evicting older items (items with lower IDs) if needed.
Trims the stream to a given number of items, evicting older items (items with lower IDs) if needed.
- key
ID of the stream
- count
stream length
- approximate
flag that indicates if the stream length should be exactly count or few tens of entries more
- returns
the number of entries deleted from the stream.
- Definition Classes
- Streams
- final def zAdd[K, M](key: K, update: Option[Update] = None, change: Option[Changed] = None)(memberScore: MemberScore[M], memberScores: MemberScore[M]*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Add one or more members to a sorted set, or update its score if it already exists.
Add one or more members to a sorted set, or update its score if it already exists.
- key
Key of set to add to
- update
Set existing and never add elements or always set new elements and don't update existing elements
- change
Modify the return value from the number of new elements added, to the total number of elements change
- memberScore
Score that should be added to specific element for a given sorted set key
- memberScores
Rest scores that should be added to specific elements fr a given sorted set key
- returns
The number of elements added to the sorted set, not including elements already existing for which the score was updated.
- Definition Classes
- SortedSets
- final def zAddWithIncr[K, M](key: K, update: Option[Update] = None, change: Option[Changed] = None)(increment: Increment, memberScore: MemberScore[M], memberScores: MemberScore[M]*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Option[Double]]
Add one or more members to a sorted set, or update its score if it already exists.
Add one or more members to a sorted set, or update its score if it already exists.
- key
Key of set to add to.
- update
Set existing and never add elements or always set new elements and don't update existing elements
- change
Modify the return value from the number of new elements added, to the total number of elements change
- increment
When this option is specified ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode
- memberScore
Score that should be added to specific element for a given sorted set key
- memberScores
Rest scores that should be added to specific elements fr a given sorted set key
- returns
The new score of member (a double precision floating point number), or None if the operation was aborted (when called with either the XX or the NX option).
- Definition Classes
- SortedSets
- final def zCard[K](key: K)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Get the number of members in a sorted set.
Get the number of members in a sorted set.
- key
Key of a sorted set
- returns
The cardinality (number of elements) of the sorted set, or 0 if key does not exist.
- Definition Classes
- SortedSets
- final def zCount[K](key: K, range: Range)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Returns the number of elements in the sorted set at key with a score between min and max.
Returns the number of elements in the sorted set at key with a score between min and max.
- key
Key of a sorted set
- range
Min and max score (including elements with score equal to min or max)
- returns
the number of elements in the specified score range.
- Definition Classes
- SortedSets
- final def zDiff[K](inputKeysNum: Long, key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Subtract multiple sorted sets and return members.
Subtract multiple sorted sets and return members.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- returns
Chunk of differences between the first and successive input sorted sets.
- Definition Classes
- SortedSets
- final def zDiffStore[DK, K](destination: DK, inputKeysNum: Long, key: K, keys: K*)(implicit arg0: Schema[DK], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Subtract multiple sorted sets and store the resulting sorted set in a destination key.
Subtract multiple sorted sets and store the resulting sorted set in a destination key.
- destination
Key of the output
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- returns
Chunk of differences between the first and successive input sorted sets.
- Definition Classes
- SortedSets
- final def zDiffWithScores[K](inputKeysNum: Long, key: K, keys: K*)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Subtract multiple sorted sets and return members and their associated score.
Subtract multiple sorted sets and return members and their associated score.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- returns
Chunk of differences and scores between the first and successive input sorted sets.
- Definition Classes
- SortedSets
- final def zIncrBy[K, M](key: K, increment: Long, member: M)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Double]
Increment the score of a member in a sorted set.
Increment the score of a member in a sorted set.
- key
Key of a sorted set
- increment
Increment value
- member
Member of sorted set
- returns
The new score of member (a double precision floating point number).
- Definition Classes
- SortedSets
- final def zInter[K](inputKeysNum: Long, key: K, keys: K*)(aggregate: Option[Aggregate] = None, weights: Option[::[Double]] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Intersect multiple sorted sets and return members.
Intersect multiple sorted sets and return members.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of the rest sorted sets
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- returns
Chunk containing the intersection of members.
- Definition Classes
- SortedSets
- final def zInterStore[DK, K](destination: DK, inputKeysNum: Long, key: K, keys: K*)(aggregate: Option[Aggregate] = None, weights: Option[::[Double]] = None)(implicit arg0: Schema[DK], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Intersect multiple sorted sets and store the resulting sorted set in a new key.
Intersect multiple sorted sets and store the resulting sorted set in a new key.
- destination
Key of the output
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of the rest sorted sets
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- returns
The number of elements in the resulting sorted set at destination.
- Definition Classes
- SortedSets
- final def zInterWithScores[K](inputKeysNum: Long, key: K, keys: K*)(aggregate: Option[Aggregate] = None, weights: Option[::[Double]] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Intersect multiple sorted sets and return members and their associated score.
Intersect multiple sorted sets and return members and their associated score.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of the rest sorted sets
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- returns
Chunk containing the intersection of members with their score.
- Definition Classes
- SortedSets
- final def zLexCount[K](key: K, lexRange: LexRange)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Count the number of members in a sorted set between a given lexicographical range.
Count the number of members in a sorted set between a given lexicographical range.
- key
Key of a sorted set
- lexRange
LexRange that must be satisfied
- returns
The number of elements in the specified score range.
- Definition Classes
- SortedSets
- final def zMScore[K](key: K, keys: K*)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Chunk[Option[Double]]]
Returns the scores associated with the specified members in the sorted set stored at key.
Returns the scores associated with the specified members in the sorted set stored at key.
- key
Key of the set
- keys
Keys of the rest sets
- returns
List of scores or None associated with the specified member values (a double precision floating point number).
- Definition Classes
- SortedSets
- final def zPopMax[K](key: K, count: Option[Long] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Remove and return members with the highest scores in a sorted set.
Remove and return members with the highest scores in a sorted set.
- key
Key of a sorted set
- count
When left unspecified, the default value for count is 1. Specifying a count value that is higher than the sorted set's cardinality will not produce an error. When returning multiple elements, the one with the highest score will be the first, followed by the elements with lower scores
- returns
Chunk of popped elements and scores.
- Definition Classes
- SortedSets
- final def zPopMin[K](key: K, count: Option[Long] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Remove and return members with the lowest scores in a sorted set.
Remove and return members with the lowest scores in a sorted set.
- key
Key of a sorted set
- count
When left unspecified, the default value for count is 1. Specifying a count value that is higher than the sorted set's cardinality will not produce an error. When returning multiple elements, the one with the lowest score will be the first, followed by the elements with greater scores
- returns
Chunk of popped elements and scores.
- Definition Classes
- SortedSets
- final def zRandMember[K](key: K, count: Long)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return random elements from the sorted set value stored at key.
Return random elements from the sorted set value stored at key.
- key
Key of a sorted set
- count
If the provided count argument is positive, return an array of distinct elements. The array's length is either count or the sorted set's cardinality (ZCARD), whichever is lower
- returns
Return an array of elements from the sorted set value stored at key.
- Definition Classes
- SortedSets
- final def zRandMember[K](key: K)(implicit arg0: Schema[K]): ResultBuilder1[Option]
Return a random element from the sorted set value stored at key.
Return a random element from the sorted set value stored at key.
- key
Key of a sorted set
- returns
Return a random element from the sorted set value stored at key.
- Definition Classes
- SortedSets
- final def zRandMemberWithScores[K](key: K, count: Long)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Return random elements from the sorted set value stored at key.
Return random elements from the sorted set value stored at key.
- key
Key of a sorted set
- count
If the provided count argument is positive, return an array of distinct elements. The array's length is either count or the sorted set's cardinality (ZCARD), whichever is lower
- returns
When the additional count argument is passed, the command returns an array of elements, or an empty array when key does not exist. If the WITHSCORES modifier is used, the reply is a list elements and their scores from the sorted set.
- Definition Classes
- SortedSets
- final def zRange[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by index.
Return a range of members in a sorted set, by index.
- key
Key of a sorted set
- range
Inclusive range
- returns
Chunk of elements in the specified range.
- Definition Classes
- SortedSets
- final def zRangeByLex[K](key: K, lexRange: LexRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by lexicographical range.
Return a range of members in a sorted set, by lexicographical range.
- key
Key of a sorted set
- lexRange
LexRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements in the specified score range.
- Definition Classes
- SortedSets
- final def zRangeByScore[K](key: K, scoreRange: ScoreRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by score.
Return a range of members in a sorted set, by score.
- key
Key of a sorted set
- scoreRange
ScoreRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements in the specified score range.
- Definition Classes
- SortedSets
- final def zRangeByScoreWithScores[K](key: K, scoreRange: ScoreRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Return a range of members in a sorted set, by score.
Return a range of members in a sorted set, by score.
- key
Key of a sorted set
- scoreRange
ScoreRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements with their scores in the specified score range.
- Definition Classes
- SortedSets
- final def zRangeWithScores[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Return a range of members in a sorted set, by index.
Return a range of members in a sorted set, by index.
- key
Key of a sorted set
- range
Inclusive range
- returns
Chunk of elements with their scores in the specified range.
- Definition Classes
- SortedSets
- final def zRank[K, M](key: K, member: M)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Option[Long]]
Determine the index of a member in a sorted set.
Determine the index of a member in a sorted set.
- key
Key of a sorted set
- member
Member of sorted set
- returns
The rank of member in the sorted set stored at key, with the scores ordered from low to high.
- Definition Classes
- SortedSets
- final def zRem[K, M](key: K, firstMember: M, restMembers: M*)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Long]
Remove one or more members from a sorted set.
Remove one or more members from a sorted set.
- key
Key of a sorted set
- firstMember
Member to be removed
- restMembers
Rest members to be removed
- returns
The number of members removed from the sorted set, not including non existing members.
- Definition Classes
- SortedSets
- final def zRemRangeByLex[K](key: K, lexRange: LexRange)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Remove all members in a sorted set between the given lexicographical range.
Remove all members in a sorted set between the given lexicographical range.
- key
Key of a sorted set
- lexRange
LexRange that must be satisfied
- returns
The number of elements removed.
- Definition Classes
- SortedSets
- final def zRemRangeByRank[K](key: K, range: Range)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Remove all members in a sorted set within the given indexes.
Remove all members in a sorted set within the given indexes.
- key
Key of a sorted set
- range
Range that must be satisfied
- returns
The number of elements removed.
- Definition Classes
- SortedSets
- final def zRemRangeByScore[K](key: K, scoreRange: ScoreRange)(implicit arg0: Schema[K]): ZIO[Redis, RedisError, Long]
Remove all members in a sorted set within the given scores.
Remove all members in a sorted set within the given scores.
- key
Key of a sorted set
- scoreRange
ScoreRange that must be satisfied
- returns
The number of elements removed.
- Definition Classes
- SortedSets
- final def zRevRange[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by index, with scores ordered from high to low.
Return a range of members in a sorted set, by index, with scores ordered from high to low.
- key
Key of a sorted set
- range
Range that must be satisfied
- returns
Chunk of elements in the specified range.
- Definition Classes
- SortedSets
- final def zRevRangeByLex[K](key: K, lexRange: LexRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.
- key
Key of a sorted set
- lexRange
LexRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements in the specified score range.
- Definition Classes
- SortedSets
- final def zRevRangeByScore[K](key: K, scoreRange: ScoreRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Return a range of members in a sorted set, by score, with scores ordered from high to low.
Return a range of members in a sorted set, by score, with scores ordered from high to low.
- key
Key of a sorted set
- scoreRange
ScoreRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements in the specified range.
- Definition Classes
- SortedSets
- final def zRevRangeByScoreWithScores[K](key: K, scoreRange: ScoreRange, limit: Option[Limit] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Return a range of members in a sorted set, by score, with scores ordered from high to low.
Return a range of members in a sorted set, by score, with scores ordered from high to low.
- key
Key of a sorted set
- scoreRange
ScoreRange that must be satisfied
- limit
The optional LIMIT argument can be used to only get a range of the matching elements. A negative count returns all elements from the offset
- returns
Chunk of elements with their scores in the specified range.
- Definition Classes
- SortedSets
- final def zRevRangeWithScores[K](key: K, range: Range)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Return a range of members in a sorted set, by index, with scores ordered from high to low.
Return a range of members in a sorted set, by index, with scores ordered from high to low.
- key
Key of a sorted set
- range
Range that must be satisfied
- returns
Chunk of elements with their scores in the specified range.
- Definition Classes
- SortedSets
- final def zRevRank[K, M](key: K, member: M)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Option[Long]]
Determine the index of a member in a sorted set, with scores ordered from high to low.
Determine the index of a member in a sorted set, with scores ordered from high to low.
- key
Key of a sorted set
- member
Member of sorted set
- returns
The rank of member.
- Definition Classes
- SortedSets
- final def zScan[K](key: K, cursor: Long, pattern: Option[String] = None, count: Option[Count] = None)(implicit arg0: Schema[K]): ResultBuilder1[[x](Long, Chunk[MemberScore[x]])]
Incrementally iterate sorted sets elements and associated scores.
Incrementally iterate sorted sets elements and associated scores.
- key
Key of the set to scan
- cursor
Cursor to use for this iteration of scan
- pattern
Glob-style pattern that filters which elements are returned
- count
Count of elements. Roughly this number will be returned by Redis if possible
- returns
Returns the items for this iteration or nothing when you reach the end.
- Definition Classes
- SortedSets
- final def zScore[K, M](key: K, member: M)(implicit arg0: Schema[K], arg1: Schema[M]): ZIO[Redis, RedisError, Option[Double]]
Get the score associated with the given member in a sorted set.
Get the score associated with the given member in a sorted set.
- key
Key of a sorted set
- member
Member of sorted set
- returns
The score of member (a double precision floating point number.
- Definition Classes
- SortedSets
- final def zUnion[K](inputKeysNum: Long, key: K, keys: K*)(weights: Option[::[Double]] = None, aggregate: Option[Aggregate] = None)(implicit arg0: Schema[K]): ResultBuilder1[Chunk]
Add multiple sorted sets and return each member.
Add multiple sorted sets and return each member.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- returns
Chunk of all members in each sorted set.
- Definition Classes
- SortedSets
- final def zUnionStore[DK, K](destination: DK, inputKeysNum: Long, key: K, keys: K*)(weights: Option[::[Double]] = None, aggregate: Option[Aggregate] = None)(implicit arg0: Schema[DK], arg1: Schema[K]): ZIO[Redis, RedisError, Long]
Add multiple sorted sets and store the resulting sorted set in a new key.
Add multiple sorted sets and store the resulting sorted set in a new key.
- destination
Key of the output
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- returns
The number of elements in the resulting sorted set at destination.
- Definition Classes
- SortedSets
- final def zUnionWithScores[K](inputKeysNum: Long, key: K, keys: K*)(weights: Option[::[Double]] = None, aggregate: Option[Aggregate] = None)(implicit arg0: Schema[K]): ResultBuilder1[MemberScores]
Add multiple sorted sets and return each member and associated score.
Add multiple sorted sets and return each member and associated score.
- inputKeysNum
Number of input keys
- key
Key of a sorted set
- keys
Keys of other sorted sets
- weights
Represents WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set. This means that the score of every element in every input sorted set is multiplied by this factor before being passed to the aggregation function. When WEIGHTS is not given, the multiplication factors default to 1
- aggregate
With the AGGREGATE option, it is possible to specify how the results of the union are aggregated
- returns
Chunk of all members with their scores in each sorted set.
- Definition Classes
- SortedSets
- case object BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
- object Input
- object Output
- object RedisCommand
- object RedisConfig extends Serializable
- object RedisError extends Serializable
- object RedisExecutor
- object RedisLive extends Serializable
- object RespValue extends Serializable
- object ResultBuilder
- object ClientFlag
- Definition Classes
- Connection
- object ClientKillFilter
- Definition Classes
- Connection
- object ClientPauseMode
- Definition Classes
- Connection
- object ClientTrackingMode
- Definition Classes
- Connection
- object ClientTrackingRedirect
- Definition Classes
- Connection
- object ClientType
- Definition Classes
- Connection
- object UnblockBehavior
- Definition Classes
- Connection
- object RadiusUnit
- Definition Classes
- Geo
- case object WithCoord extends Product with Serializable
- Definition Classes
- Geo
- case object WithDist extends Product with Serializable
- Definition Classes
- Geo
- case object WithHash extends Product with Serializable
- Definition Classes
- Geo
- case object AbsTtl extends Product with Serializable
- Definition Classes
- Keys
- case object Alpha extends Product with Serializable
- Definition Classes
- Keys
- case object Copy extends Product with Serializable
- Definition Classes
- Keys
- object RedisType extends Serializable
- Definition Classes
- Keys
- case object Replace extends Product with Serializable
- Definition Classes
- Keys
- object Position
- Definition Classes
- Lists
- object Side
- Definition Classes
- Lists
- object DebugMode
- Definition Classes
- Scripting
- object Order
- Definition Classes
- Shared
- object Update
- Definition Classes
- Shared
- object Aggregate
- Definition Classes
- SortedSets
- case object Changed extends Product with Serializable
- Definition Classes
- SortedSets
- case object Increment extends Product with Serializable
- Definition Classes
- SortedSets
- object LexMaximum
- Definition Classes
- SortedSets
- object LexMinimum
- Definition Classes
- SortedSets
- object ScoreMaximum
- Definition Classes
- SortedSets
- object ScoreMinimum
- Definition Classes
- SortedSets
- case object WithScores extends Product with Serializable
- Definition Classes
- SortedSets
- case object MkStream extends Product with Serializable
- Definition Classes
- Streams
- case object NoAck extends Product with Serializable
- Definition Classes
- Streams
- object StreamConsumersInfo extends Serializable
- Definition Classes
- Streams
- object StreamGroupsInfo extends Serializable
- Definition Classes
- Streams
- object StreamInfo extends Serializable
- Definition Classes
- Streams
- object StreamInfoWithFull
- Definition Classes
- Streams
- case object WithForce extends Product with Serializable
- Definition Classes
- Streams
- case object WithJustId extends Product with Serializable
- Definition Classes
- Streams
- object XGroupCommand
- Definition Classes
- Streams
- object BitFieldCommand
- Definition Classes
- Strings
- object BitFieldType
- Definition Classes
- Strings
- object BitOperation
- Definition Classes
- Strings
- object Expire
- Definition Classes
- Strings
- object ExpiredAt
- Definition Classes
- Strings
- case object KeepTtl extends Product with Serializable
- Definition Classes
- Strings
- object LcsOutput
- Definition Classes
- Strings
- object StrAlgoLcsQueryType
- Definition Classes
- Strings
- object StralgoLCS
- Definition Classes
- Strings