MEMCACHED_EXIST(3)

πŸ’… MEMCACHED_EXIST β€” libmemcached-awesome πŸ’…

okay bestie, welcome to MEMCACHED_EXIST(3), straight outta the libmemcached-awesome manual set πŸŽ€ this is the one where you're just peeking β€” "hey does this key even exist??" β€” no reads, no writes, just a lil vibe check on your cache ✨


🌸 NAME 🌸

memcached_exist β€” libmemcached Documentation πŸ’–


✨ SYNOPSIS ✨

like, literally just pull it in:

#include <libmemcached/memcached.h>

and bestie you have to compile and link with -lmemcached or she will not show up. no cap. 🫢

memcached_return_t memcached_exist(memcached_st *ptr, char *key, size_t *key_length)

memcached_return_t memcached_exist_by_key(memcached_st *ptr, char *group_key, size_t *group_key_length, char *key, size_t *key_length)

🌈 Parameters

  • ptr β€” pointer to an initialized memcached_st struct πŸ‘‘ (yes it must be initialized, don't be doing nonsense)
  • group_key β€” the key namespace πŸ—‚οΈ
  • group_key_length β€” length of the group_key without any terminating zero
  • key β€” the key to check πŸ”
  • key_length β€” length of the key without any terminating zero

πŸ’œ Returns

memcached_return_t indicating success ⭐

πŸ“Œ Added in version 0.53. so if you're on something older, she's not there yet, sorry bestie 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

memcached_exist() can be used to check if a key exists. that's it, that's the whole thing πŸ’… it's giving "am I being ghosted or is this key actually real" energy. use it, love it, periodt.


πŸ’– RETURN VALUE πŸ’–

  • MEMCACHED_SUCCESS β€” The key exists. πŸŽ‰ she's alive!! iconic!!
  • MEMCACHED_NOTFOUND β€” The key was not found. πŸ’€ not me getting left on read by the cache

πŸŽ€ SEE ALSO πŸŽ€

memcached(1) libmemcached(3) memcached_strerror(3) β€” go read those too, iykyk 🧚


version 1.1, dated Jul 24, 2025 β€” that's the libmemcached-awesome glow-up, and honestly? she ate. mwah πŸ’‹ bye bestie, go check some keys πŸ¦‹βœ¨

πŸ“¦ where this page comes from