0 votes
in MemCached by
How to prepend value of key?

1 Answer

0 votes
by

By using prepend command, you can prepend value of the key.

Syntax

  1. prepend key flags exptime bytes [noreply]  
  2. value  

Example

In the given example, we are trying to add some data in a key that does not exist. Hence, NOT_STORED is returned by Memcached. After this, we set one key and prepend data into it.

  1. prepend tutorials 0 900 5  
  2. redis  
  3. NOT_STORED  
  4. set tutorials 0 900 9  
  5. memcached  
  6. STORED  
  7. get tutorials  
  8. VALUE tutorials 0 14  
  9. memcached  
  10. END  
  11. prepend tutorials 0 900 5  
  12. redis  
  13. STORED  
  14. get tutorials  
  15. VALUE tutorials 0 14  
  16. redismemcached  
  17. END  

Related questions

0 votes
asked Jun 15, 2022 in MemCached by sharadyadav1986
0 votes
asked Jul 29, 2023 in MemCached by sharadyadav1986
...