diff --git a/src/FreeRedis/FreeRedis.xml b/src/FreeRedis/FreeRedis.xml
index c27b3f42..b4c16619 100644
--- a/src/FreeRedis/FreeRedis.xml
+++ b/src/FreeRedis/FreeRedis.xml
@@ -1109,6 +1109,26 @@
成功/失败
+
+
+ 随机返回N个元素
+ Redis 6.2.0+以上才支持该命令
+
+ Key
+ 返回的个数
+ 是否允许有重复元素返回
+
+
+
+
+ 随机返回N个元素, 包含分数
+ Redis 6.2.0+以上才支持该命令
+
+ Key
+ 返回的个数
+ 是否允许有重复元素返回
+
+
APPEND command (A Synchronized Version)
diff --git a/src/FreeRedis/RedisClient/SortedSets.cs b/src/FreeRedis/RedisClient/SortedSets.cs
index 87b4fe5e..261ce749 100644
--- a/src/FreeRedis/RedisClient/SortedSets.cs
+++ b/src/FreeRedis/RedisClient/SortedSets.cs
@@ -268,6 +268,29 @@ long ZStore(bool inter, string destination, string[] keys, int[] weights, ZAggre
.InputIf(weights?.Any() == true, weights)
.InputIf(aggregate != null, "AGGREGATE", aggregate ?? ZAggregate.max), rt => rt
.ThrowOrValue());
+
+ ///
+ /// 随机返回N个元素
+ /// Redis 6.2.0+以上才支持该命令
+ ///
+ /// Key
+ /// 返回的个数
+ /// 是否允许有重复元素返回
+ ///
+ public string[] ZRandMember(string key, int count, bool repetition) => Call("ZRANDMEMBER".InputKey(key, repetition ? -count : count), rt => rt.ThrowOrValue());
+
+ ///
+ /// 随机返回N个元素, 包含分数
+ /// Redis 6.2.0+以上才支持该命令
+ ///
+ /// Key
+ /// 返回的个数
+ /// 是否允许有重复元素返回
+ ///
+ public ZMember[] ZRandMemberWithScores(string key, int count, bool repetition) => Call("ZRANDMEMBER"
+ .InputKey(key, repetition ? -count : count)
+ .Input("WITHSCORES"), rt => rt
+ .ThrowOrValue((a, _) => a == null || a.Length == 0 ? new ZMember[0] : a.MapToHash(rt.Encoding).Select(b => new ZMember(b.Key, b.Value)).ToArray()));
}
public class ZMember