ZMSCORE(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– NAME πŸ’–

zmscore β€” bestie, this is the Valkey Command Manual, section 3valkey, and this little icon returns the score of one or more members in a sorted set. That's it, that's the whole job. Slay. ✨


πŸŽ€ SYNOPSIS πŸŽ€

ZMSCORE key member [member...]

🌸 DESCRIPTION 🌸

Okay so here's the tea: you hand zmscore a key and it goes and fetches the scores for all the members you asked about, from the sorted set living at that key. πŸ‘‘

And listen β€” for every single member that does not exist in that sorted set? You get a nil value back. No drama, no error, just a lil nil. It's giving "you asked, I answered, the answer is nothing." πŸ’€


πŸ¦‹ REPLY πŸ¦‹

RESP2

You get one of these two, depending on the vibe:

RESP3

And in RESP3-land, it's one of these:


⚑ COMPLEXITY ⚑

O(N) β€” where N is the number of members being requested. So like, the more members you ask for, the more work it does. No cap. 🫢


πŸ” ACL CATEGORIES πŸ”

@fast @read @sortedset


πŸ“œ HISTORY πŸ“œ

  • Available since: 6.2.0 ⭐

πŸ“ EXAMPLES πŸ“

Watch her work, bestie:

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)

See how "nofield" just gets a (nil)? Exactly. She said "not in my set, not my problem." 😭


πŸ‘‘ SEE ALSO πŸ‘‘

Go read these too, they're all part of the sorted-set cinematic universe:

bzmpop(3valkey), bzpopmax(3valkey), bzpopmin(3valkey), zadd(3valkey), zcard(3valkey), zcount(3valkey), zdiff(3valkey), zdiffstore(3valkey), zincrby(3valkey), zinter(3valkey), zintercard(3valkey), zinterstore(3valkey), zlexcount(3valkey), zmpop(3valkey), zpopmax(3valkey), zpopmin(3valkey), zrandmember(3valkey), zrange(3valkey), zrangebylex(3valkey), zrangebyscore(3valkey), zrangestore(3valkey), zrank(3valkey), zrem(3valkey), zremrangebylex(3valkey), zremrangebyrank(3valkey), zremrangebyscore(3valkey), zrevrange(3valkey), zrevrangebylex(3valkey), zrevrangebyscore(3valkey), zrevrank(3valkey), zscan(3valkey), zscore(3valkey), zunion(3valkey), zunionstore(3valkey)


Okay that's the whole page, mwah. πŸ’‹ This edition is 9.0.0, dated 2025-10-21, and it lives under the name ZMSCORE(3valkey) β€” go forth and score your sets, bestie. πŸ§šπŸ’œ

πŸ“¦ where this page comes from