Memcached Append Data
# Memcached append command
The Memcached append command is used to append data to the end of the **value** of an existing **key**.
### Syntax:
The basic syntax format for the append command is as follows:
append key flags exptime bytes value
The parameters are described as follows:
* **key:** The key in the key-value structure, used to look up the cached value.
* **flags:** An integer parameter that can include key-value pairs, used by the client to store additional information about the key-value pair.
* **exptime:** The length of time (in seconds) to store the key-value pair in the cache (0 means forever).
* **bytes:** The number of bytes to store in the cache.
* **noreply (optional):** This parameter tells the server not to return data.
* **value:** The value to store (always on the second line) (can be understood as the value in the key-value structure).
### Example
The example is as follows:
* First, we store a key `` with the value `memcached` in Memcached.
* Then, we use the `get` command to retrieve the value.
* Then, we use the **append** command to append "redis" to the value of the key ``.
* Finally, we use the `get` command again to retrieve the value.
set 0 900 9 memcached STORED get VALUE 0 9 memcached END append 0 900 5 redis STORED get VALUE 0 14 memcachedredis END
### Output
If the data is added successfully, the output is:
STORED
Output information explanation:
* **STORED:** Output after successful save.
* **NOT_STORED:** The key does not exist on Memcached.
* **CLIENT_ERROR:** Execution error.
YouTip