1 Deleting data from a server
2 ===========================
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
10 .. function:: memcached_return_t memcached_delete(memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
12 .. function:: memcached_return_t memcached_delete_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
14 :param ptr: pointer to initialized `memcached_st` struct
15 :param group_key: key namespace
16 :param group_key_length: length of the `group_key` without any terminating zero
17 :param key: the key to delete
18 :param key_length: the length og the `key` without any terminating zero
19 :param expiration: obsolete since :manpage:`memcached(1)` version 1.4
20 :returns: `memcached_return_t` indicating success
25 `memcached_delete` is used to delete a particular key. `memcached_delete_by_key`
26 works the same, but it takes a master key to find the given value.
28 Expiration works by placing the item into a delete queue, which means that it
29 won't be possible to retrieve it by the "get" command. The "add" and "replace"
30 commands with this key will also fail (the "set" command will succeed, however).
31 After the time passes, the item is finally deleted from server memory.
33 Please note the the memcached server removed tests for expiration in the 1.4
39 A value of type `memcached_return_t` is returned
40 On success that value will be `MEMCACHED_SUCCESS`.
41 Use `memcached_strerror` to translate this value to a printable string.
43 If you are using the non-blocking mode of the library, success only means that
44 the message was queued for delivery.
51 :manpage:`memcached(1)`
52 :manpage:`libmemcached(3)`
53 :manpage:`memcached_strerror(3)`
57 * :manpage:`memcached(1)`
58 * :doc:`../libmemcached`
59 * :doc:`memcached_strerror`