How do i append to a redis string data type?



  • Connect to the redis server

    $ ./redis-cli
    27.0.0.1:6379>
    

    Set a string value.

    27.0.0.1:6379> set  "Shopping List" "Eggs, Orange Juice, Bread" 
    OK
    

    Append to the "Shopping List" string.

    127.0.0.1:6379> append "Shopping List" ", Milk, always the milk"
    (integer) 47
    127.0.0.1:6379> get "Shopping List"
    "Eggs, Orange Juice, Bread, Milk, always the milk"
    

Log in to reply
 

© Lightnetics 2024