Memcached Increment and Decrement Operations with Python Example

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/memcached-increment-decrement-operations-python-example/
PINTEREST
PINTEREST
INSTAGRAM

As we see before we have done Set CAS operation to increment counter key value. Here is a operator to increment and decrement values directly.

  • incr  is the operation
  • key is the key we want to increment
  • incrementvalue the value we want to increment

Example

Let’s do simple example

Now we have a key named counter we want to increment it.

Decrement

  • decr  is the operation
  • key is the key we want to increment
  • decrementvalue the value we want to increment

Example

  • decr is the operation
  • counter is the key we want to decrement
  • is how much we want to decrement
  • 122 is the result after decrements

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/memcached-increment-decrement-operations-python-example/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Shebang Linux Term

Leave a Reply

Your email address will not be published.