@@ -19,6 +19,11 @@ trait SetOperations { self: Redis =>
1919 def spop [A ](key : Any )(implicit format : Format , parse : Parse [A ]): Option [A ] =
2020 send(" SPOP" , List (key))(asBulk)
2121
22+ // SPOP
23+ // Remove and return multiple random elements (pop) from the Set value at key since (3.2).
24+ def spop [A ](key : Any , count : Int )(implicit format : Format , parse : Parse [A ]): Option [Set [Option [A ]]] =
25+ send(" SPOP" , List (key, count))(asSet)
26+
2227 // SMOVE
2328 // Move the specified member from one Set to another atomically.
2429 def smove (sourceKey : Any , destKey : Any , value : Any )(implicit format : Format ): Option [Long ] =
@@ -40,7 +45,7 @@ trait SetOperations { self: Redis =>
4045 send(" SINTER" , key :: keys.toList)(asSet)
4146
4247 // SINTERSTORE
43- // Compute the intersection between the Sets stored at key1, key2, ..., keyN,
48+ // Compute the intersection between the Sets stored at key1, key2, ..., keyN,
4449 // and store the resulting Set at dstkey.
4550 // SINTERSTORE returns the size of the intersection, unlike what the documentation says
4651 // refer http://code.google.com/p/redis/issues/detail?id=121
@@ -53,7 +58,7 @@ trait SetOperations { self: Redis =>
5358 send(" SUNION" , key :: keys.toList)(asSet)
5459
5560 // SUNIONSTORE
56- // Compute the union between the Sets stored at key1, key2, ..., keyN,
61+ // Compute the union between the Sets stored at key1, key2, ..., keyN,
5762 // and store the resulting Set at dstkey.
5863 // SUNIONSTORE returns the size of the union, unlike what the documentation says
5964 // refer http://code.google.com/p/redis/issues/detail?id=121
@@ -66,7 +71,7 @@ trait SetOperations { self: Redis =>
6671 send(" SDIFF" , key :: keys.toList)(asSet)
6772
6873 // SDIFFSTORE
69- // Compute the difference between the Set key1 and all the Sets key2, ..., keyN,
74+ // Compute the difference between the Set key1 and all the Sets key2, ..., keyN,
7075 // and store the resulting Set at dstkey.
7176 def sdiffstore (key : Any , keys : Any * )(implicit format : Format ): Option [Long ] =
7277 send(" SDIFFSTORE" , key :: keys.toList)(asLong)
0 commit comments