View source on GitHub |
Atomically decrements a key's value.
google.appengine.api.memcache.decr(
key, delta=1, namespace=None, initial_value=None
)
Internally, the value is a unsigned 64-bit integer. Memcache caps decrementing below zero to zero.
The key must already exist in the cache to be decremented. See
docs on incr()
for details.
Returns | |
---|---|
If key was a single value, the new long integer value, or None if key
was not in the cache, could not be decremented for any other reason, or
a network/RPC/server error occurred.
If key was an iterable collection, a dictionary will be returned mapping supplied keys to values, with the values having the same meaning as the singular return value of this method. |
Raises | |
---|---|
ValueError
|
If number is negative. |
TypeError
|
If delta isn't an int or long. |