@@ -41,6 +41,7 @@ import {
4141 createLRange ,
4242 createLRem ,
4343 createLTrim ,
44+ createLindex ,
4445 createMGet ,
4546 createMSet ,
4647 createPExpire ,
@@ -61,9 +62,9 @@ import {
6162 createZadd ,
6263 createZcard ,
6364 createZcount ,
65+ createZpopmin ,
6466 createZrem ,
6567 createZscore ,
66- createLindex ,
6768} from "./Commands" ;
6869import { redis_request } from "./ProtobufMessage" ;
6970
@@ -858,13 +859,30 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
858859 * See https://redis.io/commands/strlen/ for more details.
859860 *
860861 * @param key - The `key` to check its length.
862+ *
861863 * Command Response - The length of the string value stored at `key`
862864 * If `key` does not exist, it is treated as an empty string, and the command returns 0.
863865 */
864866 public strlen ( key : string ) : T {
865867 return this . addAndReturn ( createStrlen ( key ) ) ;
866868 }
867869
870+ /** Removes and returns the members with the lowest scores from the sorted set stored at `key`.
871+ * If `count` is provided, up to `count` members with the lowest scores are removed and returned.
872+ * Otherwise, only one member with the lowest score is removed and returned.
873+ * See https://redis.io/commands/zpopmin for more details.
874+ *
875+ * @param key - The key of the sorted set.
876+ * @param count - Specifies the quantity of members to pop. If not specified, pops one member.
877+ * If `count` is higher than the sorted set's cardinality, returns all members and their scores.
878+ *
879+ * Command Response - A map of the removed members and their scores, ordered from the one with the lowest score to the one with the highest.
880+ * If `key` doesn't exist, it will be treated as an empty sorted set and the command returns an empty map.
881+ */
882+ public zpopmin ( key : string , count ?: number ) : T {
883+ return this . addAndReturn ( createZpopmin ( key , count ) ) ;
884+ }
885+
868886 /** Executes a single command, without checking inputs. Every part of the command, including subcommands,
869887 * should be added as a separate value in args.
870888 *
0 commit comments