Search:

Search all manuals
Search this manual
Manual
Membase Client Library: Python
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
4 Membase Client Library: Python — Retrieve Operations
Chapter Sections
Chapters

4.3. Get-and-Touch (GAT) Methods

The Get-and-Touch gat() method obtains a value for a given key and update the expiry time for the key. This can be useful for session values and other information where you want to set an expiry time, but don't want the value to expire while the value is still in use.

API Callobject.gat(key, expiry)
Asynchronousno
Description Get a value and update the expiration time for a given key
Returns(none)
Arguments 
key Document ID used to identify the value
expiry Expiry time for key. Values larger than 30*24*60*60 seconds (30 days) are interpreted as absolute times (from the epoch).

The gat() function obtains a given value and updates the expiry time. For example, to get session data and renew the expiry time to five minutes:

membase.gat('sessionid',300);