What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

ZMSCORE

Returns the score of one or more members in a sorted set.

Usage
ZMSCORE key member ...
Complexity
O(N) where N is the number of members being requested.
Since
6.2.0
ACL Categories
@fast, @read, @sortedset
Command flags
READONLY, FAST

Returns the scores associated with the specified members in the sorted set stored at key.

For every member that does not exist in the sorted set, a nil value is returned.

Examples

127.0.0.1:6379> ZADD myzset 1 "one"
(integer) 1
127.0.0.1:6379> ZADD myzset 2 "two"
(integer) 1
127.0.0.1:6379> ZMSCORE myzset "one" "two" "nofield"
1) "1"
2) "2"
3) (nil)

Replies

RESP2

One of the following:

RESP3

One of the following: