f37630908cd17cba1c1ce1c189c2c04e919bd3ed
[awesomized/libmemcached] / docs / source / libmemcached / memcached_delete.rst
1 Deleting data from a server
2 ===========================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: memcached_return_t memcached_delete (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
11
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)
13
14
15 DESCRIPTION
16 -----------
17
18 `memcached_delete` is used to delete a particular key. `memcached_delete_by_key`
19 works the same, but it takes a master key to find the given value.
20
21 Expiration works by placing the item into a delete queue, which means that it
22 won't be possible to retrieve it by the "get" command. The "add" and "replace"
23 commands with this key will also fail (the "set" command will succeed, however).
24 After the time passes, the item is finally deleted from server memory.
25
26 Please note the the memcached server removed tests for expiration in the 1.4
27 version.
28
29 RETURN VALUE
30 ------------
31
32 A value of type `memcached_return_t` is returned
33 On success that value will be `MEMCACHED_SUCCESS`.
34 Use `memcached_strerror` to translate this value to a printable string.
35
36 If you are using the non-blocking mode of the library, success only means that
37 the message was queued for delivery.
38
39 SEE ALSO
40 --------
41
42 .. only:: man
43
44 :manpage:`memcached(1)`
45 :manpage:`libmemcached(3)`
46 :manpage:`memcached_strerror(3)`
47
48 .. only:: html
49
50 * :manpage:`memcached(1)`
51 * :doc:`../libmemcached`
52 * :doc:`memcached_strerror`