Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_exist.rst
1 Determine if a keys exists
2 ==========================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: memcached_return_t memcached_exist(memcached_st *ptr, char *key, size_t *key_length)
11
12 .. function:: memcached_return_t memcached_exist_by_key(memcached_st *ptr, char *group_key, size_t *group_key_length, char *key, size_t *key_length)
13
14 :param ptr: pointer to an initialized `memcached_st` struct
15 :param group_key: the key namespace
16 :param group_key_length: length of the `group_key` without any terminating zero
17 :param key: the key to check
18 :param key_length: length of the `key` without any terminating zero
19 :returns: `memcached_return_t` indicating success
20
21 .. versionadded:: 0.53
22
23 DESCRIPTION
24 -----------
25
26 :func:`memcached_exist()` can be used to check if a key exists.
27
28 RETURN VALUE
29 ------------
30
31 `MEMCACHED_SUCCESS`
32 The key exists.
33
34 `MEMCACHED_NOTFOUND`
35 The key was not found.
36
37 SEE ALSO
38 --------
39
40 .. only:: man
41
42 :manpage:`memcached(1)`
43 :manpage:`libmemcached(3)`
44 :manpage:`memcached_strerror(3)`
45
46 .. only:: html
47
48 * :manpage:`memcached(1)`
49 * :doc:`../libmemcached`
50 * :doc:`memcached_strerror`