OBJECT-REFCOUNT(3valkey)

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

✨ OBJECT-REFCOUNT ✨ (from the valkey manual, section 3, bestie πŸ’–)

okay so real talk, this one is SO simple and that's exactly why it's iconic πŸ’…

πŸŽ€ NAME πŸŽ€

object-refcount β€” literally just tells you how many references are pointing at the value stored at a key. that's it. that's the whole job. queen behavior.


πŸ¦‹ SYNOPSIS πŸ¦‹

OBJECT REFCOUNT key

This command returns the reference count of the stored at <key>. (yes i know, the original sentence is missing a word, i'm not gonna gaslight you and pretend it isn't β€” it means the reference count of the value stored at <key>. the way that grammar just gave up 😭)


🌸 REPLY 🌸

πŸ’œ RESP2

One of the following, bestie:

πŸ’œ RESP3

One of the following:

not me pointing out that RESP2 says "Nil" and RESP3 says "Null" β€” yes they're two different things, and no i will not be the one to conflate them. character development πŸ™ˆ

🧚 COMPLEXITY 🧚

O(1) β€” constant time, no cap. she does not care how big your keyspace is, she is NOT scrolling. main character energy only πŸ‘‘


🌈 ACL CATEGORIES 🌈

  • @keyspace
  • @read
  • @slow

lowkey the @slow tag is doing the most here considering it's literally O(1), but the categories said what they said and i respect the system 🫢


πŸ“ HISTORY πŸ“

  • Available since: 2.2.3 β€” she's an OG, been here since basically forever, a true vintage icon ✨

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're all in the same friend group:


and that's the whole page, we ate and left absolutely no crumbs πŸ’…βœ¨ this was version 9.0.0, dated 2025-10-21, brought to you by the valkey girlies. stay refcounted, stay iconic, ily πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from