Easy Tutorial
❮ Memcached Incr Decr Memcached Stats Items ❯

Memcached add Command

The Memcached add command is used to store a value in the specified key.

If the key being added already exists, the data will not be updated (expired keys will be updated), and the previous value will remain unchanged, with a response of NOT_STORED.

Syntax:

The basic syntax for the add command is as follows:

add key flags exptime bytes [noreply]
value

Parameter descriptions are as follows:

Example

In the following example, we set:

Output

If the data is added successfully, the output will be:

STORED

Output information descriptions are as follows:

❮ Memcached Incr Decr Memcached Stats Items ❯