Interface StringRedisConnection
- All Superinterfaces:
AutoCloseable,DefaultedRedisConnection,RedisCommands,RedisCommandsProvider,RedisConnection,RedisConnectionCommands,RedisGeoCommands,RedisHashCommands,RedisHyperLogLogCommands,RedisKeyCommands,RedisListCommands,RedisPubSubCommands,RedisScriptingCommands,RedisServerCommands,RedisSetCommands,RedisStreamCommands,RedisStringCommands,RedisTxCommands,RedisZSetCommands
- All Known Implementing Classes:
DefaultStringRedisConnection
Convenience extension of
RedisConnection that accepts and returns Strings instead of byte arrays.
Uses a RedisSerializer underneath to perform the conversion.- Author:
- Costin Leau, Christoph Strobl, Thomas Darimont, David Liu, Mark Paluch, Ninad Divadkar, Tugdual Grall, Dengliming, Andrey Shlykov, ihaohong, Shyngys Sapraliyev, Jeonggyu Choi, Mingi Lee
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceString-friendly ZSet tuple.Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisHashCommands
RedisHashCommands.HashFieldSetOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Direction, RedisListCommands.PositionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptionsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs -
Method Summary
Modifier and TypeMethodDescriptionAppend avaluetokey.Count the number of set bits (population counting) in value stored atkey.Count the number of set bits (population counting) of value stored atkeybetweenstartandend.bitfield(@NonNull String key, @NonNull BitFieldSubCommands command) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey.bitOp(@NonNull RedisStringCommands.BitOperation op, @NonNull String destination, @NonNull String @NonNull ... keys) Perform bitwise operations between strings.default LongReturn the position of the first bit set to givenbitin a string.Return the position of the first bit set to givenbitin a string.bLMove(@NonNull String sourceKey, @NonNull String destinationKey, @NonNull RedisListCommands.Direction from, @NonNull RedisListCommands.Direction to, double timeout) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.Removes and returns first element from lists stored atkeys(see:DefaultedRedisConnection.lPop(byte[])).Removes and returns last element from lists stored atkeys(see:DefaultedRedisConnection.rPop(byte[])).bRPopLPush(int timeout, @NonNull String srcKey, @NonNull String dstKey) Remove the last element from list atsrcKey, append it todstKeyand return its value (seeDefaultedRedisConnection.rPopLPush(byte[], byte[])).Remove and return the value with its score having the highest score from sorted set atkey.Remove and return the value with its score having the lowest score from sorted set atkey.Copy givensourceKeytotargetKey.Decrement an integer value stored as string value ofkeyby 1.Decrement an integer value stored as string value ofkeybyvalue.Delete givenkeys.Returnsmessagevia server roundtrip.encodingOf(@NonNull String key) Get the type of internal representation used for storing the value at the givenkey.static RecordId[]<T> Teval(@NonNull String script, @NonNull ReturnType returnType, int numKeys, @NonNull String @NonNull ... keysAndArgs) Evaluate givenscript.<T> TevalSha(@NonNull String scriptSha, @NonNull ReturnType returnType, int numKeys, @NonNull String @NonNull ... keysAndArgs) Evaluate givenscriptSha.'Native' or 'raw' execution of the given command along-side the given arguments.'Native' or 'raw' execution of the given command along-side the given arguments.Determine if givenkeyexists.Count how many of the givenkeysexist.default BooleanSet time to live for givenkeyin seconds.expire(@NonNull String key, long seconds, @NonNull ExpirationOptions.Condition condition) Set time to live for givenkeyin seconds.default BooleanSet the expiration for givenkeyas a UNIX timestamp.expireAt(@NonNull String key, long unixTime, @NonNull ExpirationOptions.Condition condition) Set the expiration for givenkeyas a UNIX timestamp.geoAdd(@NonNull String key, @NonNull Iterable<@NonNull RedisGeoCommands.GeoLocation<String>> locations) AddRedisGeoCommands.GeoLocations to keyAddPointwith given member name to key.geoAdd(@NonNull String key, @NonNull RedisGeoCommands.GeoLocation<String> location) AddRedisGeoCommands.GeoLocationto key.Get theDistancebetween member1 and member2.geoDist(@NonNull String key, @NonNull String member1, @NonNull String member2, @NonNull Metric metric) Get geohash representation of the position for one or more members.Get thePointrepresentation of positions for one or more members.Get the members within the boundaries of a givenCircle.geoRadius(@NonNull String key, @NonNull Circle within, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.geoRadiusByMember(@NonNull String key, @NonNull String member, double radius) Get the members within the circle defined by the members coordinates and given radius.geoRadiusByMember(@NonNull String key, @NonNull String member, @NonNull Distance radius) Get the members within the circle defined by the members coordinates and givenDistance.geoRadiusByMember(@NonNull String key, @NonNull String member, @NonNull Distance radius, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and givenDistanceandRedisGeoCommands.GeoRadiusCommandArgs.Remove the members.geoSearch(@NonNull String key, @NonNull GeoReference<String> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape.geoSearchStore(String destKey, @NonNull String key, @NonNull GeoReference<String> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshapeand store the result atdestKey.Get the value ofkey.Get the bit value atoffsetof value atkey.Request information and statistics about connected clients.Return the value atkeyand delete the key.getEx(@NonNull String key, @NonNull Expiration expiration) Return the value atkeyand expire the key by applyingExpiration.Get a substring of value ofkeybetweenstartandend.Setvalueofkeyand return its old value.Delete given hashfields.Determine if given hashfieldexists.Set time to live for givenfieldin seconds.hExpire(@NonNull String key, long seconds, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set time to live for givenfieldin seconds.Set the expiration for givenfieldas a UNIX timestamp.hExpireAt(@NonNull String key, long unixTime, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp.Get value for givenfieldfrom hash atkey.Get entire hash stored atkey.Get and delete the value of one or morefieldsfrom hash atkey.hGetEx(@NonNull String key, Expiration expiration, @NonNull String @NonNull ... fields) Get the value of one or morefieldsfrom hash atkeyand optionally set expiration time or time-to-live (TTL) for givenfields.Incrementvalueof a hashfieldby the givendelta.Incrementvalueof a hashfieldby the givendelta.Get key set (fields) of hash atkey.Get size of hash atkey.Get values for givenfieldsfrom hash atkey.voidSet multiple hash fields to multiple values using data provided inhashesRemove the expiration from givenfield.Set time to live for givenfieldin milliseconds.hpExpire(@NonNull String key, long millis, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set time to live for givenfieldin milliseconds.hpExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp in milliseconds.hpExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp in milliseconds.Get the time to live forfieldsin seconds.hRandField(@NonNull String key) Return a random field from the hash stored atkey.hRandField(@NonNull String key, long count) Return a random field from the hash stored atkey.hRandFieldWithValues(@NonNull String key) Return a random field from the hash along with its value stored atkey.hRandFieldWithValues(@NonNull String key, long count) Return a random field from the hash along with its value stored atkey.hScan(@NonNull String key, ScanOptions options) Use aCursorto iterate over entries in hash atkey.Set thevalueof a hashfield.hSetEx(@NonNull String key, @NonNull Map<@NonNull String, String> hashes, @NonNull RedisHashCommands.HashFieldSetOption condition, @Nullable Expiration expiration) Set field-value pairs in hash at key with optional condition and expiration.Set thevalueof a hashfieldonly iffielddoes not exist.Returns the length of the value associated withfieldin the hash stored atkey.Get the time to live forfieldsin seconds.Get the time to live forfieldsin and convert it to the givenTimeUnit.Get entry set (values) of hash atfield.Get theDurationsince the object stored at the givenkeyis idle.Increment an integer value stored as string value ofkeyby 1.Increment a floating point number value ofkeybydelta.Increment an integer value stored ofkeybydelta.Retrieve all keys matching the given pattern viaKEYScommand.Get element atindexform list atkey.lInsert(@NonNull String key, @NonNull RedisListCommands.Position where, @NonNull String pivot, String value) InsertvalueRedisListCommands.Position.BEFOREorRedisListCommands.Position.AFTERexistingpivotforkey.Get the size of list stored atkey.lMove(@NonNull String sourceKey, @NonNull String destinationKey, @NonNull RedisListCommands.Direction from, @NonNull RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.Removes and returns first element in list stored atkey.Removes and returns first elements in list stored atkey.default LongReturns the index of matching elements inside the list stored at given key.Returns the index of matching elements inside the list stored at given key.Prependvaluestokey.Prependvaluestokeyonly if the list exists.Get elements betweenstartandendfrom list atkey.Removes the firstcountoccurrences ofvaluefrom the list stored atkey.voidSet thevaluelist element atindex.voidTrim list atkeyto elements betweenstartandend.Get multiplekeys.Move givenkeyto database withindex.mSetNXString(@NonNull Map<@NonNull String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intupleonly if the provided key does not exist.mSetString(@NonNull Map<@NonNull String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intuple.Remove the expiration from givenkey.default BooleanSet time to live for givenkeyin milliseconds.pExpire(@NonNull String key, long millis, @NonNull ExpirationOptions.Condition condition) Set time to live for givenkeyin milliseconds.default BooleanSet the expiration for givenkeyas a UNIX timestamp in milliseconds.pExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull ExpirationOptions.Condition condition) Set the expiration for givenkeyas a UNIX timestamp in milliseconds.Adds given values to the HyperLogLog stored at given key.Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).voidMerge N different HyperLogLogs at sourceKeys into a single destinationKey.Set thevalueand expiration inmillisecondsforkey.voidpSubscribe(@NonNull MessageListener listener, @NonNull String @NonNull ... patterns) Subscribes the connection to all channels matching the given patterns.Get the precise time to live forkeyin milliseconds.Get the precise time to live forkeyin and convert it to the givenTimeUnit.Publishes the given message to the given channel.Get the number of references of the value associated with the specifiedkey.voidRename keyoldKeytonewKey.Rename keyoldKeytonewKeyonly ifnewKeydoes not exist.Removes and returns last element in list stored atkey.Removes and returns last elements in list stored atkey.Remove the last element from list atsrcKey, append it todstKeyand return its value.Appendvaluestokey.Appendvaluestokeyonly if the list exists.Add givenvaluesto set atkey.Get size of set atkey.scriptLoad(@NonNull String script) Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...).Diff all sets for givenkeys.sDiffStore(String destKey, String... keys) Diff all sets for givenkeysand store result indestKey.Setvalueforkey.set(@NonNull String key, @NonNull String value, @Nullable Expiration expiration, @Nullable RedisStringCommands.SetOption option) Setvalueforkeyapplying timeouts fromexpirationif set and inserting/updating values depending onoption.Sets the bit atoffsetin value stored atkey.voidsetClientName(@NonNull String name) Assign given name to current connection.Set thevalueand expiration insecondsforkey.Setvalueforkey, only ifkeydoes not exist.voidOverwrite parts ofkeystarting at the specifiedoffsetwith givenvalue.Returns the members intersecting all given sets atkeys.sInterCard(@NonNull String @NonNull ... keys) Returns the cardinality of the set which would result from the intersection of all the given sets.sInterStore(@NonNull String destKey, @NonNull String @NonNull ... keys) Intersect all given sets atkeysand store result indestKey.Check if set atkeycontainsvalue.Get all elements of set atkey.sMIsMember(@NonNull String key, String... values) Check if set atkeycontains one or morevalues.MovevaluefromsrcKeytodestKeysort(@NonNull String key, @NonNull SortParameters params) Sort the elements forkey.sort(@NonNull String key, @NonNull SortParameters params, @NonNull String storeKey) Sort the elements forkeyand store result instoreKey.Remove and return a random member from set atkey.Remove and returncountrandom members from set atkey.sRandMember(@NonNull String key) Get random element from set atkey.sRandMember(@NonNull String key, long count) Getcountrandom elements from set atkey.Remove givenvaluesfrom set atkeyand return the number of removed elements.sScan(@NonNull String key, ScanOptions options) Use aCursorto iterate over elements in set atkey.Get the length of the value stored atkey.voidsubscribe(@NonNull MessageListener listener, @NonNull String @NonNull ... channels) Subscribes the connection to the given channels.Union all sets at givenkeys.sUnionStore(String destKey, String... keys) Union all sets at givenkeysand store result indestKey.Alter the last access time of givenkey(s).Get the time to live forkeyin seconds.Get the time to live forkeyin and convert it to the givenTimeUnit.Determine the type stored atkey.Unlink thekeysfrom the keyspace.default LongAcknowledge one or more record as processed.default RecordIdAppend a record to the streamkey.default RecordIdxAdd(@NonNull StringRecord record) Append the givenStringRecordto the stream stored atRecord.getStream().xAdd(@NonNull StringRecord record, @NonNull RedisStreamCommands.XAddOptions options) Append the givenStringRecordto the stream stored atRecord.getStream().default List<StringRecord>xClaim(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull Duration minIdleTime, @NonNull RecordId @NonNull ... recordIds) Change the ownership of a pending message to the given new consumer.xClaim(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.xClaimJustId(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count.default LongRemoves the specified entries from the stream.xGroupCreate(@NonNull String key, @NonNull ReadOffset readOffset, @NonNull String group) Create a consumer group.xGroupCreate(@NonNull String key, @NonNull ReadOffset readOffset, @NonNull String group, boolean mkStream) Create a consumer group.xGroupDelConsumer(@NonNull String key, @NonNull Consumer consumer) Delete a consumer from a consumer group.xGroupDestroy(@NonNull String key, String group) Destroy a consumer group.Obtain general information about the stream stored at the specified key.xInfoConsumers(@NonNull String key, @NonNull String groupName) Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.xInfoGroups(@NonNull String key) Obtain information about consumer groups associated with the stream stored at the specified key.Get the length of a stream.Obtain thePendingMessagesSummaryfor a given consumer group.xPending(@NonNull String key, @NonNull String groupName, @NonNull String consumerName, @NonNull Range<String> range, @NonNull Long count) xPending(@NonNull String key, @NonNull String groupName, @NonNull String consumerName, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) xPending(@NonNull String key, @NonNull String groupName, @NonNull Range<String> range, @NonNull Long count) xPending(@NonNull String key, @NonNull String groupName, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) xPending(@NonNull String key, @NonNull String groupName, @NonNull RedisStreamCommands.XPendingOptions options) default PendingMessagesxPending(@NonNull String key, @NonNull Consumer consumer, @NonNull Range<String> range, @NonNull Long count) default PendingMessagesxPending(@NonNull String key, @NonNull Consumer consumer, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) default List<StringRecord>Read records from a stream within a specificRedisZSetCommands.Range.Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimit.default List<StringRecord>xReadAsString(@NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets.default List<StringRecord>xReadAsString(@NonNull StreamOffset<String>... streams) Read records from one or moreStreamOffsets.default List<StringRecord>xReadAsString(@NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets.xReadAsString(@NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String>... streams) Read records from one or moreStreamOffsets.default List<StringRecord>xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamOffset<String> @NonNull ... streams) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> @NonNull ... streams) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>Read records from a stream within a specificRedisZSetCommands.Rangein reverse order.Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimitin reverse order.Trims the stream tocountelements.Trims the stream tocountelements.Addvalueto a sorted set atkey, or update itsscoreif it already exists.zAdd(@NonNull String key, double score, String value, RedisZSetCommands.ZAddArgs args) zAdd(@NonNull String key, Set<StringRedisConnection.StringTuple> tuples) Addtuplesto a sorted set atkey, or update itsscoreif it already exists.zAdd(@NonNull String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) Get the size of sorted set withkey.Count number of elements within sorted set with scores betweenminandmax.Diff sortedsets.zDiffStore(@NonNull String destKey, @NonNull String @NonNull ... sets) Diff sortedsetsand store result in destinationdestKey.zDiffWithScores(@NonNull String @NonNull ... sets) Diff sortedsets.Increment the score of element withvaluein sorted set byincrement.Intersect sortedsets.zInterStore(@NonNull String destKey, @NonNull String @NonNull ... sets) Intersect sortedsetsand store result in destinationkey.zInterStore(@NonNull String destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Intersect sortedsetsand store result in destinationkey.zInterWithScores(@NonNull String @NonNull ... sets) Intersect sortedsets.default Set<StringRedisConnection.StringTuple>zInterWithScores(@NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Intersect sortedsets.zInterWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, @NonNull String @NonNull ... sets) Intersect sortedsets.Count number of elements within sorted set with value betweenRange#minandRange#maxapplying lexicographical ordering.Get the scores of elements withvaluesfrom sorted set with keykey.Remove and return the value with its score having the highest score from sorted set atkey.Remove and returncountvalues with their score having the highest score from sorted set atkey.Remove and return the value with its score having the lowest score from sorted set atkey.Remove and returncountvalues with their score having the lowest score from sorted set atkey.zRandMember(@NonNull String key) Get random element from sorted set atkey.zRandMember(@NonNull String key, long count) Getcountrandom elements from sorted set atkey.zRandMemberWithScore(@NonNull String key) Get random element from sorted set atkey.zRandMemberWithScores(@NonNull String key, long count) Getcountrandom elements from sorted set atkey.Get elements betweenstartandendfrom sorted set.zRangeByLex(@NonNull String key) Get all the elements in the sorted set at key in lexicographical ordering.zRangeByLex(@NonNull String key, @NonNull Range<String> range) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.zRangeByLex(@NonNull String key, @NonNull Range<String> range, @NonNull Limit limit) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.zRangeByScore(@NonNull String key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set.zRangeByScore(@NonNull String key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.zRangeByScore(@NonNull String key, @NonNull String min, @NonNull String max) Get elements where score is betweenminandmaxfrom sorted set.zRangeByScore(@NonNull String key, @NonNull String min, @NonNull String max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.zRangeByScoreWithScores(@NonNull String key, double min, double max) zRangeByScoreWithScores(@NonNull String key, double min, double max, long offset, long count) default LongzRangeStoreByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range) This command is like ZRANGE , but stores the result in the dstKey destination key.zRangeStoreByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range, @NonNull Limit limit) This command is like ZRANGE , but stores the result in the dstKey destination key.default LongzRangeStoreByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range) This command is like ZRANGE, but stores the result in the dstKey destination key.zRangeStoreByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) This command is like ZRANGE, but stores the result in the dstKey destination key.default LongzRangeStoreRevByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.zRangeStoreRevByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range, @NonNull Limit limit) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.default LongzRangeStoreRevByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeStoreRevByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeWithScores(@NonNull String key, long start, long end) Determine the index of element withvaluein a sorted set.Removevaluesfrom sorted set.Remove elements in range betweenstartandendfrom sorted set withkey.zRemRangeByLex(@NonNull String key, @NonNull Range<String> range) Remove all elements between the lexicographicalRedisZSetCommands.Range.zRemRangeByScore(@NonNull String key, double min, double max) Remove elements with scores betweenminandmaxfrom sorted set withkey.Get elements in range fromstarttoendfrom sorted set ordered from high to low.zRevRangeByLex(@NonNull String key) Get all the elements in the sorted set at key in reversed lexicographical ordering.zRevRangeByLex(@NonNull String key, @NonNull Range<String> range) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.zRevRangeByLex(@NonNull String key, @NonNull Range<String> range, @NonNull Limit limit) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.zRevRangeByScore(@NonNull String key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.zRevRangeByScore(@NonNull String key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.zRevRangeByScoreWithScores(@NonNull String key, double min, double max) zRevRangeByScoreWithScores(@NonNull String key, double min, double max, long offset, long count) Get set ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.zRevRangeWithScores(@NonNull String key, long start, long end) Determine the index of element withvaluein a sorted set when scored high to low.zScan(@NonNull String key, ScanOptions options) Use aCursorto iterate over elements in sorted set atkey.Get the score of element withvaluefrom sorted set with keykey.Union sortedsets.zUnionStore(@NonNull String destKey, @NonNull String @NonNull ... sets) Union sortedsetsand store result in destinationkey.zUnionStore(@NonNull String destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Union sortedsetsand store result in destinationkey.zUnionWithScores(@NonNull String @NonNull ... sets) Union sortedsets.default Set<StringRedisConnection.StringTuple>zUnionWithScores(@NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Union sortedsets.zUnionWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, @NonNull String @NonNull ... sets) Union sortedsets.Methods inherited from interface org.springframework.data.redis.connection.DefaultedRedisConnection
append, applyHashFieldExpiration, bgReWriteAof, bgSave, bitCount, bitCount, bitField, bitOp, bitPos, bLMove, bLPop, bRPop, bRPopLPush, bZPopMax, bZPopMin, copy, dbSize, decr, decrBy, del, dump, encodingOf, eval, evalSha, evalSha, exists, exists, expire, expire, expireAt, expireAt, flushAll, flushAll, flushDb, flushDb, geoAdd, geoAdd, geoAdd, geoDist, geoDist, geoHash, geoPos, geoRadius, geoRadius, geoRadiusByMember, geoRadiusByMember, geoRemove, geoSearch, geoSearchStore, get, getBit, getClientName, getConfig, getDel, getEx, getRange, getSet, hDel, hExists, hExpire, hExpire, hExpireAt, hExpireAt, hGet, hGetAll, hGetDel, hGetEx, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hPersist, hpExpire, hpExpire, hpExpireAt, hpExpireAt, hpTtl, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, hSetEx, hSetNX, hStrLen, hTtl, hTtl, hVals, idletime, incr, incrBy, incrBy, info, info, keys, killClient, lastSave, lIndex, lInsert, lLen, lMove, lPop, lPop, lPos, lPush, lPushX, lRange, lRem, lSet, lTrim, mGet, migrate, migrate, move, mSet, mSetNX, persist, pExpire, pExpire, pExpireAt, pExpireAt, pfAdd, pfCount, pfMerge, pSetEx, pTtl, pTtl, randomKey, refcount, rename, renameNX, replicaOf, replicaOfNoOne, resetConfigStats, restore, rewriteConfig, rPop, rPop, rPopLPush, rPush, rPushX, sAdd, save, scan, sCard, scriptExists, scriptFlush, scriptKill, scriptLoad, sDiff, sDiffStore, set, set, setBit, setClientName, setConfig, setEx, setGet, setNX, setRange, shutdown, shutdown, sInter, sInterCard, sInterStore, sIsMember, sMembers, sMIsMember, sMove, sort, sort, sPop, sPop, sRandMember, sRandMember, sRem, sScan, strLen, sUnion, sUnionStore, time, time, touch, ttl, ttl, type, unlink, xAck, xAdd, xClaim, xClaimJustId, xDel, xGroupCreate, xGroupCreate, xGroupDelConsumer, xGroupDestroy, xInfo, xInfoConsumers, xInfoGroups, xLen, xPending, xPending, xRange, xRange, xRead, xRead, xReadGroup, xReadGroup, xRevRange, xRevRange, xTrim, xTrim, zAdd, zAdd, zCard, zCount, zCount, zDiff, zDiffStore, zDiffWithScores, zIncrBy, zInter, zInterStore, zInterStore, zInterStore, zInterWithScores, zInterWithScores, zInterWithScores, zLexCount, zMScore, zPopMax, zPopMax, zPopMin, zPopMin, zRandMember, zRandMember, zRandMemberWithScore, zRandMemberWithScore, zRange, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByLex, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByLex, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnion, zUnionStore, zUnionStore, zUnionStore, zUnionWithScores, zUnionWithScores, zUnionWithScoresMethods inherited from interface org.springframework.data.redis.connection.RedisCommands
executeMethods inherited from interface org.springframework.data.redis.connection.RedisCommandsProvider
commands, geoCommands, hashCommands, hyperLogLogCommands, keyCommands, listCommands, scriptingCommands, serverCommands, setCommands, streamCommands, stringCommands, zSetCommandsMethods inherited from interface org.springframework.data.redis.connection.RedisConnection
close, closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipelineMethods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
echo, ping, selectMethods inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
geoAdd, geoRadiusByMemberMethods inherited from interface org.springframework.data.redis.connection.RedisHashCommands
applyHashFieldExpiration, hExpire, hpExpireMethods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
applyExpiration, expire, expireAt, pExpire, pExpireAt, restore, scanMethods inherited from interface org.springframework.data.redis.connection.RedisListCommands
lPosMethods inherited from interface org.springframework.data.redis.connection.RedisPubSubCommands
getSubscription, isSubscribed, pSubscribe, publish, subscribeMethods inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending, xPending, xPending, xPendingMethods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
bitPosMethods inherited from interface org.springframework.data.redis.connection.RedisTxCommands
discard, exec, multi, unwatch, watchMethods inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
-
Method Details
-
execute
'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is, with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or the result.- Parameters:
command- Command to executeargs- Possible command arguments (may be null)- Returns:
- execution result.
- See Also:
-
execute
'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is, with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or the result.- Parameters:
command- Command to execute- Returns:
- execution result.
- See Also:
-
exists
Determine if givenkeyexists.- Parameters:
key- must not be null.- Returns:
- See Also:
-
exists
Count how many of the givenkeysexist.- Parameters:
keys- must not be null.- Returns:
- Since:
- 2.1
- See Also:
-
del
Delete givenkeys.- Parameters:
keys- must not be null.- Returns:
- The number of keys that were removed.
- See Also:
-
copy
Copy givensourceKeytotargetKey.- Parameters:
sourceKey- must not be null.targetKey- must not be null.replace- whether to replace existing keys.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unlink
Unlink thekeysfrom the keyspace. Unlike withdel(String...)the actual memory reclaiming here happens asynchronously.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
type
Determine the type stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
touch
Alter the last access time of givenkey(s).- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
keys
Retrieve all keys matching the given pattern viaKEYScommand.IMPORTANT: This command is non-interruptible and scans the entire keyspace which may cause performance issues. Consider
DefaultedRedisConnection.scan(ScanOptions)for large datasets.- Parameters:
pattern- must not be null.- Returns:
- See Also:
-
rename
Rename keyoldKeytonewKey.- Parameters:
oldKey- must not be null.newKey- must not be null.- See Also:
-
renameNX
Rename keyoldKeytonewKeyonly ifnewKeydoes not exist.- Parameters:
oldKey- must not be null.newKey- must not be null.- Returns:
- See Also:
-
expire
Set time to live for givenkeyin seconds.- Parameters:
key- must not be null.seconds-- Returns:
- See Also:
-
expire
Set time to live for givenkeyin seconds.- Parameters:
key- must not be null.condition- the condition for expiration, must not be null.seconds-- Returns:
- Since:
- 3.5
- See Also:
-
pExpire
Set time to live for givenkeyin milliseconds.- Parameters:
key- must not be null.millis-- Returns:
- See Also:
-
pExpire
Set time to live for givenkeyin milliseconds.- Parameters:
key- must not be null.millis-condition- the condition for expiration, must not be null.- Returns:
- Since:
- 3.5
- See Also:
-
expireAt
Set the expiration for givenkeyas a UNIX timestamp.- Parameters:
key- must not be null.unixTime-- Returns:
- See Also:
-
expireAt
Boolean expireAt(@NonNull String key, long unixTime, @NonNull ExpirationOptions.Condition condition) Set the expiration for givenkeyas a UNIX timestamp.- Parameters:
key- must not be null.unixTime-condition- the condition for expiration, must not be null.- Returns:
- Since:
- 3.5
- See Also:
-
pExpireAt
Set the expiration for givenkeyas a UNIX timestamp in milliseconds.- Parameters:
key- must not be null.unixTimeInMillis-- Returns:
- See Also:
-
pExpireAt
Boolean pExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull ExpirationOptions.Condition condition) Set the expiration for givenkeyas a UNIX timestamp in milliseconds.- Parameters:
key- must not be null.unixTimeInMillis-condition- the condition for expiration, must not be null.- Returns:
- Since:
- 3.5
- See Also:
-
persist
Remove the expiration from givenkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
move
Move givenkeyto database withindex.- Parameters:
key- must not be null.dbIndex-- Returns:
- See Also:
-
ttl
Get the time to live forkeyin seconds.- Parameters:
key- must not be null.- Returns:
- See Also:
-
ttl
Get the time to live forkeyin and convert it to the givenTimeUnit.- Parameters:
key- must not be null.timeUnit- must not be null.- Returns:
- Since:
- 1.8
- See Also:
-
pTtl
Get the precise time to live forkeyin milliseconds.- Parameters:
key- must not be null.- Returns:
- See Also:
-
pTtl
Get the precise time to live forkeyin and convert it to the givenTimeUnit.- Parameters:
key- must not be null.timeUnit- must not be null.- Returns:
- Since:
- 1.8
- See Also:
-
echo
Returnsmessagevia server roundtrip.- Parameters:
message- the message to echo.- Returns:
- See Also:
-
sort
Sort the elements forkey.- Parameters:
key- must not be null.params- must not be null.- Returns:
- See Also:
-
sort
Sort the elements forkeyand store result instoreKey.- Parameters:
key- must not be null.params- must not be null.storeKey- must not be null.- Returns:
- See Also:
-
encodingOf
Get the type of internal representation used for storing the value at the givenkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
idletime
Get theDurationsince the object stored at the givenkeyis idle.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
refcount
Get the number of references of the value associated with the specifiedkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
get
Get the value ofkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
getDel
Return the value atkeyand delete the key.- Parameters:
key- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getEx
Return the value atkeyand expire the key by applyingExpiration.- Parameters:
key- must not be null.expiration- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getSet
Setvalueofkeyand return its old value.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
mGet
Get multiplekeys. Values are in the order of the requested keys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
set
Setvalueforkey.- Parameters:
key- must not be null.value- must not be null.- See Also:
-
set
Boolean set(@NonNull String key, @NonNull String value, @Nullable Expiration expiration, @Nullable RedisStringCommands.SetOption option) Setvalueforkeyapplying timeouts fromexpirationif set and inserting/updating values depending onoption.- Parameters:
key- must not be null.value- must not be null.expiration- can be null. Defaulted toExpiration.persistent(). UseExpiration.keepTtl()to keep the existing expiration.option- can be null. Defaulted toRedisStringCommands.SetOption.UPSERT.- Since:
- 1.7
- See Also:
-
setNX
Setvalueforkey, only ifkeydoes not exist.- Parameters:
key- must not be null.value- must not be null.- Returns:
- See Also:
-
setEx
Set thevalueand expiration insecondsforkey.- Parameters:
key- must not be null.seconds-value- must not be null.- See Also:
-
pSetEx
Set thevalueand expiration inmillisecondsforkey.- Parameters:
key- must not be null.milliseconds-value- must not be null.- Since:
- 1.3
- See Also:
-
mSetString
Set multiple keys to multiple values using key-value pairs provided intuple.- Parameters:
tuple- must not be null.- See Also:
-
mSetNXString
Set multiple keys to multiple values using key-value pairs provided intupleonly if the provided key does not exist.- Parameters:
tuple- must not be null.- See Also:
-
incr
Increment an integer value stored as string value ofkeyby 1.- Parameters:
key- must not be null.- Returns:
- See Also:
-
incrBy
Increment an integer value stored ofkeybydelta.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
incrBy
Increment a floating point number value ofkeybydelta.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
decr
Decrement an integer value stored as string value ofkeyby 1.- Parameters:
key- must not be null.- Returns:
- See Also:
-
decrBy
Decrement an integer value stored as string value ofkeybyvalue.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
append
Append avaluetokey.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
getRange
Get a substring of value ofkeybetweenstartandend.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
setRange
Overwrite parts ofkeystarting at the specifiedoffsetwith givenvalue.- Parameters:
key- must not be null.value-offset-- See Also:
-
getBit
Get the bit value atoffsetof value atkey.- Parameters:
key- must not be null.offset-- Returns:
- See Also:
-
setBit
Sets the bit atoffsetin value stored atkey.- Parameters:
key- must not be null.offset-value-- Returns:
- the original bit value stored at
offset. - See Also:
-
bitCount
Count the number of set bits (population counting) in value stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
bitCount
Count the number of set bits (population counting) of value stored atkeybetweenstartandend.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
bitOp
Long bitOp(@NonNull RedisStringCommands.BitOperation op, @NonNull String destination, @NonNull String @NonNull ... keys) Perform bitwise operations between strings.- Parameters:
op- must not be null.destination- must not be null.keys- must not be null.- Returns:
- See Also:
-
bitPos
Return the position of the first bit set to givenbitin a string.- Parameters:
key- the key holding the actual String.bit- the bit value to look for.- Returns:
- null when used in pipeline / transaction. The position of the first bit set to 1 or 0 according to the request.
- Since:
- 2.1
- See Also:
-
bitPos
Return the position of the first bit set to givenbitin a string.Rangestart and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate.- Parameters:
key- the key holding the actual String.bit- the bit value to look for.range- must not be null. UseRedisZSetCommands.Range.unbounded()to not limit search.- Returns:
- null when used in pipeline / transaction. The position of the first bit set to 1 or 0 according to the request.
- Since:
- 2.1
- See Also:
-
strLen
Get the length of the value stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
rPush
Appendvaluestokey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
lPos
Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- Parameters:
key- must not be null.element- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
lPos
List<Long> lPos(@NonNull String key, @NonNull String element, @Nullable Integer rank, @Nullable Integer count) Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- Parameters:
key- must not be null.element- must not be null.rank- specifies the "rank" of the first element to return, in case there are multiple matches. A rank of 1 means to return the first match, 2 to return the second match, and so forth.count- number of matches to return.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
lPush
Prependvaluestokey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
rPushX
Appendvaluestokeyonly if the list exists.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
lPushX
Prependvaluestokeyonly if the list exists.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
lLen
Get the size of list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
lRange
Get elements betweenstartandendfrom list atkey.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
lTrim
Trim list atkeyto elements betweenstartandend.- Parameters:
key- must not be null.start-end-- See Also:
-
lIndex
Get element atindexform list atkey.- Parameters:
key- must not be null.index-- Returns:
- See Also:
-
lInsert
Long lInsert(@NonNull String key, @NonNull RedisListCommands.Position where, @NonNull String pivot, String value) InsertvalueRedisListCommands.Position.BEFOREorRedisListCommands.Position.AFTERexistingpivotforkey.- Parameters:
key- must not be null.where- must not be null.pivot-value-- Returns:
- See Also:
-
lMove
String lMove(@NonNull String sourceKey, @NonNull String destinationKey, @NonNull RedisListCommands.Direction from, @NonNull RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.- Parameters:
sourceKey- must not be null.destinationKey- must not be null.from- must not be null.to- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
bLMove
String bLMove(@NonNull String sourceKey, @NonNull String destinationKey, @NonNull RedisListCommands.Direction from, @NonNull RedisListCommands.Direction to, double timeout) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.- Parameters:
sourceKey- must not be null.destinationKey- must not be null.from- must not be null.to- must not be null.timeout-- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
lSet
Set thevaluelist element atindex.- Parameters:
key- must not be null.index-value-- See Also:
-
lRem
Removes the firstcountoccurrences ofvaluefrom the list stored atkey.- Parameters:
key- must not be null.count-value-- Returns:
- See Also:
-
lPop
Removes and returns first element in list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
lPop
Removes and returns first elements in list stored atkey.- Parameters:
key- must not be null.count-- Returns:
- Since:
- 2.6
- See Also:
-
rPop
Removes and returns last element in list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
rPop
Removes and returns last elements in list stored atkey.- Parameters:
key- must not be null.count-- Returns:
- Since:
- 2.6
- See Also:
-
bLPop
Removes and returns first element from lists stored atkeys(see:DefaultedRedisConnection.lPop(byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-keys- must not be null.- Returns:
- See Also:
-
bRPop
Removes and returns last element from lists stored atkeys(see:DefaultedRedisConnection.rPop(byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-keys- must not be null.- Returns:
- See Also:
-
rPopLPush
Remove the last element from list atsrcKey, append it todstKeyand return its value.- Parameters:
srcKey- must not be null.dstKey- must not be null.- Returns:
- See Also:
-
bRPopLPush
Remove the last element from list atsrcKey, append it todstKeyand return its value (seeDefaultedRedisConnection.rPopLPush(byte[], byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-srcKey- must not be null.dstKey- must not be null.- Returns:
- See Also:
-
sAdd
Add givenvaluesto set atkey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
sRem
Remove givenvaluesfrom set atkeyand return the number of removed elements.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
sPop
Remove and return a random member from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sPop
Remove and returncountrandom members from set atkey.- Parameters:
key- must not be null.count- the number of random members to return.- Returns:
- empty
Listif key does not exist. - Since:
- 2.0
- See Also:
-
sMove
MovevaluefromsrcKeytodestKey- Parameters:
srcKey- must not be null.destKey- must not be null.value-- Returns:
- See Also:
-
sCard
Get size of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sIsMember
Check if set atkeycontainsvalue.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
sMIsMember
Check if set atkeycontains one or morevalues.- Parameters:
key- must not be null.values- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
sInter
Returns the members intersecting all given sets atkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sInterStore
Intersect all given sets atkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sInterCard
Returns the cardinality of the set which would result from the intersection of all the given sets.- Parameters:
keys- must not be null.- Returns:
- Since:
- 4.0
- See Also:
-
sUnion
Union all sets at givenkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sUnionStore
Union all sets at givenkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sDiff
Diff all sets for givenkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sDiffStore
Diff all sets for givenkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sMembers
Get all elements of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sRandMember
Get random element from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sRandMember
Getcountrandom elements from set atkey.- Parameters:
key- must not be null.count-- Returns:
- See Also:
-
sScan
Use aCursorto iterate over elements in set atkey.- Parameters:
key- must not be null.options- must not be null.- Returns:
- Since:
- 1.4
- See Also:
-
zAdd
Addvalueto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.score- the score.value- the value.- Returns:
- See Also:
-
zAdd
- Parameters:
key- must not be null.score- must not be null.value- must not be null.args- must not be null useRedisZSetCommands.ZAddArgs.empty()instead.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zAdd
Addtuplesto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.tuples- the tuples.- Returns:
- See Also:
-
zAdd
Long zAdd(@NonNull String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) - Parameters:
key- must not be null.tuples- must not be null.args- must not be null useRedisZSetCommands.ZAddArgs.empty()instead.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zRem
Removevaluesfrom sorted set. Return number of removed elements.- Parameters:
key- must not be null.values- must not be null.- Returns:
- See Also:
-
zIncrBy
Increment the score of element withvaluein sorted set byincrement.- Parameters:
key- must not be null.increment-value- the value.- Returns:
- See Also:
-
zRandMember
Get random element from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMember
Getcountrandom elements from sorted set atkey.- Parameters:
key- must not be null.count- if the providedcountargument is positive, return a list of distinct fields, capped either atcountor the set size. Ifcountis negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zRandMemberWithScore
Get random element from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMemberWithScores
Getcountrandom elements from sorted set atkey.- Parameters:
key- must not be null.count- if the providedcountargument is positive, return a list of distinct fields, capped either atcountor the set size. Ifcountis negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zRank
Determine the index of element withvaluein a sorted set.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zRevRank
Determine the index of element withvaluein a sorted set when scored high to low.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zRange
Get elements betweenstartandendfrom sorted set.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRangeWithScores
- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRangeByScore
Get elements where score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(@NonNull String key, double min, double max) - Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(@NonNull String key, double min, double max, long offset, long count) - Parameters:
key-min-max-offset-count-- Returns:
- See Also:
-
zRevRange
Get elements in range fromstarttoendfrom sorted set ordered from high to low.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRevRangeWithScores
Set<StringRedisConnection.StringTuple> zRevRangeWithScores(@NonNull String key, long start, long end) - Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRevRangeByScore
Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRevRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(@NonNull String key, double min, double max) - Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRevRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zRevRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(@NonNull String key, double min, double max, long offset, long count) Get set ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zCount
Count number of elements within sorted set with scores betweenminandmax.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zLexCount
Count number of elements within sorted set with value betweenRange#minandRange#maxapplying lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
zPopMin
Remove and return the value with its score having the lowest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zPopMin
Remove and returncountvalues with their score having the lowest score from sorted set atkey.- Parameters:
key- must not be null.count- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
bZPopMin
StringRedisConnection.StringTuple bZPopMin(@NonNull String key, long timeout, @NonNull TimeUnit unit) Remove and return the value with its score having the lowest score from sorted set atkey. Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zPopMax
Remove and return the value with its score having the highest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zPopMax
Remove and returncountvalues with their score having the highest score from sorted set atkey.- Parameters:
key- must not be null.count- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
bZPopMax
StringRedisConnection.StringTuple bZPopMax(@NonNull String key, long timeout, @NonNull TimeUnit unit) Remove and return the value with its score having the highest score from sorted set atkey. Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zCard
Get the size of sorted set withkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
zScore
Get the score of element withvaluefrom sorted set with keykey.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zMScore
Get the scores of elements withvaluesfrom sorted set with keykey.- Parameters:
key- must not be null.values- the values.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zRemRange
Remove elements in range betweenstartandendfrom sorted set withkey.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRemRangeByLex
Remove all elements between the lexicographicalRedisZSetCommands.Range.- Parameters:
key- must not be null.range- must not be null.- Returns:
- the number of elements removed, or null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zRemRangeByScore
Remove elements with scores betweenminandmaxfrom sorted set withkey.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zDiff
Diff sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffWithScores
Diff sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffStore
Diff sortedsetsand store result in destinationdestKey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInter
Intersect sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInterWithScores
Intersect sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInterWithScores
default Set<StringRedisConnection.StringTuple> zInterWithScores(@NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Intersect sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
zInterWithScores
Set<StringRedisConnection.StringTuple> zInterWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, @NonNull String @NonNull ... sets) Intersect sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
zInterStore
Intersect sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- See Also:
-
zInterStore
Long zInterStore(@NonNull String destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Intersect sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.aggregate- must not be null.weights-sets- must not be null.- Returns:
- See Also:
-
zUnion
Union sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
Union sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
default Set<StringRedisConnection.StringTuple> zUnionWithScores(@NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Union sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
Set<StringRedisConnection.StringTuple> zUnionWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, @NonNull String @NonNull ... sets) Union sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionStore
Union sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- See Also:
-
zUnionStore
Long zUnionStore(@NonNull String destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, @NonNull String @NonNull ... sets) Union sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.aggregate- must not be null.weights-sets- must not be null.- Returns:
- See Also:
-
zScan
Use aCursorto iterate over elements in sorted set atkey.- Parameters:
key- must not be null.options- can be null.- Returns:
- Since:
- 1.4
- See Also:
-
zRangeByScore
Get elements where score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min- must not be null.max- must not be null.- Returns:
- Since:
- 1.5
- See Also:
-
zRangeByScore
Set<String> zRangeByScore(@NonNull String key, @NonNull String min, @NonNull String max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min- must not be null.max- must not be null.offset-count-- Returns:
- Since:
- 1.5
- See Also:
-
zRangeByLex
Get all the elements in the sorted set at key in lexicographical ordering.- Parameters:
key- must not be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering. Result is limited viaLimit.- Parameters:
key- must not be null.range- must not be null.limit- must not be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRevRangeByLex
Get all the elements in the sorted set at key in reversed lexicographical ordering.- Parameters:
key- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRevRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRevRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering. Result is limited viaLimit.- Parameters:
key- must not be null.range- must not be null.limit- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRangeStoreByLex
default Long zRangeStoreByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range) This command is like ZRANGE , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreByLex
Long zRangeStoreByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range, @NonNull Limit limit) This command is like ZRANGE , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByLex
default Long zRangeStoreRevByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByLex
Long zRangeStoreRevByLex(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<String> range, @NonNull Limit limit) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreByScore
default Long zRangeStoreByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range) This command is like ZRANGE, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreByScore
Long zRangeStoreByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) This command is like ZRANGE, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByScore
default Long zRangeStoreRevByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByScore
Long zRangeStoreRevByScore(@NonNull String dstKey, @NonNull String srcKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
hSet
Set thevalueof a hashfield.- Parameters:
key- must not be null.field- must not be null.value-- Returns:
- See Also:
-
hSetNX
Set thevalueof a hashfieldonly iffielddoes not exist.- Parameters:
key- must not be null.field- must not be null.value-- Returns:
- See Also:
-
hGet
Get value for givenfieldfrom hash atkey.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hMGet
Get values for givenfieldsfrom hash atkey.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hMSet
Set multiple hash fields to multiple values using data provided inhashes- Parameters:
key- must not be null.hashes- must not be null.- See Also:
-
hIncrBy
Incrementvalueof a hashfieldby the givendelta.- Parameters:
key- must not be null.field- must not be null.delta-- Returns:
- See Also:
-
hIncrBy
Incrementvalueof a hashfieldby the givendelta.- Parameters:
key- must not be null.field-delta-- Returns:
- See Also:
-
hRandField
Return a random field from the hash stored atkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
Return a random field from the hash along with its value stored atkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandField
Return a random field from the hash stored atkey. If the providedcountargument is positive, return a list of distinct fields, capped either atcountor the hash size. Ifcountis negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Parameters:
key- must not be null.count- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
Return a random field from the hash along with its value stored atkey. If the providedcountargument is positive, return a list of distinct fields, capped either atcountor the hash size. Ifcountis negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Parameters:
key- must not be null.count- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hExists
Determine if given hashfieldexists.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hDel
Delete given hashfields.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hLen
Get size of hash atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hKeys
Get key set (fields) of hash atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hVals
Get entry set (values) of hash atfield.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hGetAll
Get entire hash stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hScan
Use aCursorto iterate over entries in hash atkey.- Parameters:
key- must not be null.options- must not be null.- Returns:
- Since:
- 1.4
- See Also:
-
hStrLen
Returns the length of the value associated withfieldin the hash stored atkey. If the key or the field do not exist,0is returned.- Parameters:
key- must not be null.field- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
-
hExpire
Set time to live for givenfieldin seconds.- Parameters:
key- must not be null.seconds- the amount of time after which the key will be expired in seconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set;-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hExpire
List<Long> hExpire(@NonNull String key, long seconds, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set time to live for givenfieldin seconds.- Parameters:
key- must not be null.seconds- the amount of time after which the key will be expired in seconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hpExpire
Set time to live for givenfieldin milliseconds.- Parameters:
key- must not be null.millis- the amount of time after which the key will be expired in milliseconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set;-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hpExpire
List<Long> hpExpire(@NonNull String key, long millis, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set time to live for givenfieldin milliseconds.- Parameters:
key- must not be null.millis- the amount of time after which the key will be expired in milliseconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hExpireAt
default List<Long> hExpireAt(@NonNull String key, long unixTime, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp.- Parameters:
key- must not be null.unixTime- the moment in time in which the field expires, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set;-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hExpireAt
List<Long> hExpireAt(@NonNull String key, long unixTime, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp.- Parameters:
key- must not be null.unixTime- the moment in time in which the field expires, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hpExpireAt
default List<Long> hpExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp in milliseconds.- Parameters:
key- must not be null.unixTimeInMillis- the moment in time in which the field expires in milliseconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set;-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hpExpireAt
List<Long> hpExpireAt(@NonNull String key, long unixTimeInMillis, @NonNull ExpirationOptions.Condition condition, @NonNull String @NonNull ... fields) Set the expiration for givenfieldas a UNIX timestamp in milliseconds.- Parameters:
key- must not be null.unixTimeInMillis- the moment in time in which the field expires in milliseconds, must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hPersist
Remove the expiration from givenfield.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided:1indicating expiration time is removed;-1field has no expiration time to be removed;-2indicating there is no such field; null when used in pipeline / transaction.null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hTtl
Get the time to live forfieldsin seconds.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided: the time to live in milliseconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hTtl
List<Long> hTtl(@NonNull String key, @NonNull TimeUnit timeUnit, @NonNull String @NonNull ... fields) Get the time to live forfieldsin and convert it to the givenTimeUnit.- Parameters:
key- must not be null.timeUnit- must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided: the time to live in theTimeUnitprovided; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hpTtl
Get the time to live forfieldsin seconds.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a list of
Longvalues for each of the fields provided: the time to live in milliseconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; null when used in pipeline / transaction. - Since:
- 3.5
- See Also:
-
hGetDel
Get and delete the value of one or morefieldsfrom hash atkey. When the last field is deleted, the key will also be deleted.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- empty
Listif key does not exist. null when used in pipeline / transaction. - See Also:
-
hGetEx
List<String> hGetEx(@NonNull String key, Expiration expiration, @NonNull String @NonNull ... fields) Get the value of one or morefieldsfrom hash atkeyand optionally set expiration time or time-to-live (TTL) for givenfields.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- empty
Listif key does not exist. null when used in pipeline / transaction. - See Also:
-
hSetEx
Boolean hSetEx(@NonNull String key, @NonNull Map<@NonNull String, String> hashes, @NonNull RedisHashCommands.HashFieldSetOption condition, @Nullable Expiration expiration) Set field-value pairs in hash at key with optional condition and expiration.- Parameters:
key- must not be null.hashes- the field-value pairs to set; must not be null.condition- the optional condition for setting fields.expiration- the optional expiration to apply.- Returns:
- never null.
- See Also:
-
pfAdd
Adds given values to the HyperLogLog stored at given key.- Parameters:
key- must not be null.values- must not be null.- Returns:
- Since:
- 1.5
- See Also:
-
pfCount
Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).- Parameters:
keys- must not be null.- Returns:
- See Also:
-
pfMerge
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.- Parameters:
destinationKey- must not be null.sourceKeys- must not be null.- See Also:
-
geoAdd
AddPointwith given member name to key.- Parameters:
key- must not be null.point- must not be null.member- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
AddRedisGeoCommands.GeoLocationto key.- Parameters:
key- must not be null.location- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
- Parameters:
key- must not be null.memberCoordinateMap- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
Long geoAdd(@NonNull String key, @NonNull Iterable<@NonNull RedisGeoCommands.GeoLocation<String>> locations) AddRedisGeoCommands.GeoLocations to key- Parameters:
key- must not be null.locations- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoDist
Get theDistancebetween member1 and member2.- Parameters:
key- must not be null.member1- must not be null.member2- must not be null.- Returns:
- can be null.
- Since:
- 1.8
- See Also:
-
geoDist
Distance geoDist(@NonNull String key, @NonNull String member1, @NonNull String member2, @NonNull Metric metric) - Parameters:
key- must not be null.member1- must not be null.member2- must not be null.metric- must not be null.- Returns:
- can be null.
- Since:
- 1.8
- See Also:
-
geoHash
Get geohash representation of the position for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoPos
Get thePointrepresentation of positions for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadius
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(@NonNull String key, @NonNull Circle within) Get the members within the boundaries of a givenCircle.- Parameters:
key- must not be null.within- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadius
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(@NonNull String key, @NonNull Circle within, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.within- must not be null.args- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(@NonNull String key, @NonNull String member, double radius) Get the members within the circle defined by the members coordinates and given radius.- Parameters:
key- must not be null.member- must not be null.radius-- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(@NonNull String key, @NonNull String member, @NonNull Distance radius) Get the members within the circle defined by the members coordinates and givenDistance.- Parameters:
key- must not be null.member- must not be null.radius- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(@NonNull String key, @NonNull String member, @NonNull Distance radius, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and givenDistanceandRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.member- must not be null.radius- must not be null.args- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRemove
Remove the members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- Number of members elements removed.
- Since:
- 1.8
- See Also:
-
geoSearch
GeoResults<RedisGeoCommands.GeoLocation<String>> geoSearch(@NonNull String key, @NonNull GeoReference<String> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape. The query's center point is provided byGeoReference.- Parameters:
key- must not be null.reference- must not be null.predicate- must not be null.args- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
geoSearchStore
Long geoSearchStore(String destKey, @NonNull String key, @NonNull GeoReference<String> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshapeand store the result atdestKey. The query's center point is provided byGeoReference.- Parameters:
key- must not be null.reference- must not be null.predicate- must not be null.args- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
publish
Publishes the given message to the given channel.- Parameters:
channel- the channel to publish to, must not be null.message- message to publish- Returns:
- the number of clients that received the message
- See Also:
-
subscribe
Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Parameters:
listener- message listener, must not be null.channels- channel names, must not be null.- See Also:
-
pSubscribe
Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Parameters:
listener- message listener, must not be null.patterns- channel name patterns, must not be null.- See Also:
-
scriptLoad
Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...).- Parameters:
script- must not be null.- Returns:
- See Also:
-
eval
<T> T eval(@NonNull String script, @NonNull ReturnType returnType, int numKeys, @NonNull String @NonNull ... keysAndArgs) Evaluate givenscript.- Parameters:
script- must not be null.returnType- must not be null.numKeys-keysAndArgs- must not be null.- Returns:
- See Also:
-
evalSha
<T> T evalSha(@NonNull String scriptSha, @NonNull ReturnType returnType, int numKeys, @NonNull String @NonNull ... keysAndArgs) Evaluate givenscriptSha.- Parameters:
scriptSha- must not be null.returnType- must not be null.numKeys-keysAndArgs- must not be null.- Returns:
- See Also:
-
setClientName
Assign given name to current connection.- Parameters:
name-- Since:
- 1.3
- See Also:
-
getClientList
List<RedisClientInfo> getClientList()Request information and statistics about connected clients.- Specified by:
getClientListin interfaceDefaultedRedisConnection- Specified by:
getClientListin interfaceRedisServerCommands- Returns:
ListofRedisClientInfoobjects.- Since:
- 1.3
- See Also:
-
bitfield
Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey.- Parameters:
key- must not be null.command- must not be null.- Returns:
-
entryIds
-
xAck
default Long xAck(@NonNull String key, @NonNull String group, @NonNull String @NonNull ... entryIds) Acknowledge one or more record as processed.- Parameters:
key- the stream key.group- name of the consumer group.entryIds- record Id's to acknowledge.- Returns:
- length of acknowledged records. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xAck
-
xAdd
Append a record to the streamkey.- Parameters:
key- the stream key.body- record body.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xAdd
Append the givenStringRecordto the stream stored atRecord.getStream().- Parameters:
record- must not be null.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 2.2
-
xAdd
Append the givenStringRecordto the stream stored atRecord.getStream().- Parameters:
record- must not be null.options- must not be null, useRedisStreamCommands.XAddOptions.none()instead.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 2.3
-
xClaimJustId
List<RecordId> xClaimJustId(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.options- must not be null.- Returns:
- list of
idsthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
default List<StringRecord> xClaim(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull Duration minIdleTime, @NonNull RecordId @NonNull ... recordIds) Change the ownership of a pending message to the given new consumer.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.minIdleTime- must not be null.recordIds- must not be null.- Returns:
- list of
StringRecordthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
List<StringRecord> xClaim(@NonNull String key, @NonNull String group, @NonNull String newOwner, @NonNull RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.options- must not be null.- Returns:
- list of
StringRecordthat changed user. - Since:
- 2.3
- See Also:
-
xDel
Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
key- the stream key.entryIds- stream record Id's.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xDel
-
xGroupCreate
Create a consumer group.- Parameters:
key- the stream key.readOffset-group- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xGroupCreate
String xGroupCreate(@NonNull String key, @NonNull ReadOffset readOffset, @NonNull String group, boolean mkStream) Create a consumer group.- Parameters:
key- the stream key.readOffset-group- name of the consumer group.mkStream- if true the group will create the stream if needed (MKSTREAM)- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- , 2.3
-
xGroupDelConsumer
Delete a consumer from a consumer group.- Parameters:
key- the stream key.consumer- consumer identified by group name and consumer key.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xGroupDestroy
Destroy a consumer group.- Parameters:
key- the stream key.group- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xInfo
Obtain general information about the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xInfoGroups
Obtain information about consumer groups associated with the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xInfoConsumers
Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.groupName- name of the consumer group.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xLen
Get the length of a stream.- Parameters:
key- the stream key.- Returns:
- length of the stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xPending
Obtain thePendingMessagesSummaryfor a given consumer group.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.- Returns:
- a summary of pending messages within the given consumer group or null when used in pipeline / transaction.
- Since:
- 2.3
- See Also:
-
xPending
PendingMessages xPending(@NonNull String key, @NonNull String groupName, @NonNull String consumerName, @NonNull Range<String> range, @NonNull Long count) - Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.consumerName- the name of the consumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
- pending messages for the given consumer group or null when used in pipeline / transaction.
- Since:
- 2.3
- See Also:
-
xPending
PendingMessages xPending(@NonNull String key, @NonNull String groupName, @NonNull String consumerName, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) Obtain detailed information about pendingmessagesfor a givenRangeand consumer within a consumer group and over a givenDurationof idle time.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.consumerName- the name of the consumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.minIdleTime- the minimum idle time to filter pending messages. Must not be null.- Returns:
- pending messages for the given consumer in given consumer group or null when used in pipeline / transaction.
- Since:
- 4.0
- See Also:
-
xPending
default PendingMessages xPending(@NonNull String key, @NonNull Consumer consumer, @NonNull Range<String> range, @NonNull Long count) Obtain detailed information about pendingmessagesfor a givenRangeandConsumerwithin a consumer group.- Parameters:
key- the key the stream is stored at. Must not be null.consumer- the name of theConsumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
- pending messages for the given
Consumeror null when used in pipeline / transaction. - Since:
- 4.0
- See Also:
-
xPending
default PendingMessages xPending(@NonNull String key, @NonNull Consumer consumer, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) Obtain detailed information about pendingmessagesfor a givenRangeandConsumerwithin a consumer group and over a givenDurationof idle time.- Parameters:
key- the key the stream is stored at. Must not be null.consumer- the name of theConsumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.minIdleTime- the minimum idle time to filter pending messages. Must not be null.- Returns:
- pending messages for the given
Consumeror null when used in pipeline / transaction. - Since:
- 4.0
- See Also:
-
xPending
PendingMessages xPending(@NonNull String key, @NonNull String groupName, @NonNull Range<String> range, @NonNull Long count) - Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
- pending messages for the given consumer group or null when used in pipeline / transaction.
- Since:
- 2.3
- See Also:
-
xPending
PendingMessages xPending(@NonNull String key, @NonNull String groupName, @NonNull Range<String> range, @NonNull Long count, @NonNull Duration minIdleTime) Obtain detailed information about pendingmessagesfor a givenRangewithin a consumer group and over a givenDurationof idle time.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.minIdleTime- the minimum idle time to filter pending messages. Must not be null.- Returns:
- pending messages for the given consumer group or null when used in pipeline / transaction.
- Since:
- 4.0
- See Also:
-
xPending
PendingMessages xPending(@NonNull String key, @NonNull String groupName, @NonNull RedisStreamCommands.XPendingOptions options) - Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.options- the options containing range, consumer and count. Must not be null.- Returns:
- pending messages matching given criteria or null when used in pipeline / transaction.
- Since:
- 2.3
- See Also:
-
xRange
Read records from a stream within a specificRedisZSetCommands.Range.- Parameters:
key- the stream key.range- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xRange
Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimit.- Parameters:
key- the stream key.range- must not be null.limit- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
Read records from one or moreStreamOffsets.- Parameters:
stream- the streams to read from.- Returns:
- list ith members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
Read records from one or moreStreamOffsets.- Parameters:
streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
default List<StringRecord> xReadAsString(@NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets.- Parameters:
readOptions- read arguments.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
List<StringRecord> xReadAsString(@NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String>... streams) Read records from one or moreStreamOffsets.- Parameters:
readOptions- read arguments.streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
default List<StringRecord> xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
default List<StringRecord> xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamOffset<String> @NonNull ... streams) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
default List<StringRecord> xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.readOptions- read arguments.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
List<StringRecord> xReadGroupAsString(@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull StreamOffset<String> @NonNull ... streams) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.readOptions- read arguments.streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xRevRange
Read records from a stream within a specificRedisZSetCommands.Rangein reverse order.- Parameters:
key- the stream key.range- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xRevRange
List<StringRecord> xRevRange(@NonNull String key, @NonNull Range<String> range, @NonNull Limit limit) Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimitin reverse order.- Parameters:
key- the stream key.range- must not be null.limit- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xTrim
Trims the stream tocountelements.- Parameters:
key- the stream key.count- length of the stream.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xTrim
Trims the stream tocountelements.- Parameters:
key- the stream key.count- length of the stream.approximateTrimming- the trimming must be performed in a approximated way in order to maximize performances.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-