本文整理汇总了Python中couchbase._libcouchbase.Connection.touch_multi方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.touch_multi方法的具体用法?Python Connection.touch_multi怎么用?Python Connection.touch_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchbase._libcouchbase.Connection
的用法示例。
在下文中一共展示了Connection.touch_multi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: touch_multi
# 需要导入模块: from couchbase._libcouchbase import Connection [as 别名]
# 或者: from couchbase._libcouchbase.Connection import touch_multi [as 别名]
def touch_multi(self, keys, ttl=0):
"""Touch multiple keys
Multi variant of :meth:`touch`
:param keys: the keys to touch
:type keys: :ref:`iterable<argtypes>`
``keys`` can also be a dictionary with values being integers, in
whic case the value for each key will be used as the TTL instead
of the global one (i.e. the one passed to this function)
:param int ttl: The new expiration time
:return: A :class:`~couchbase.libcouchbase.MultiResult` object
Update three keys to expire in 10 seconds ::
cb.touch_multi(("key1", "key2", "key3"), ttl=10)
Update three keys with different expiration times ::
cb.touch_multi({"foo" : 1, "bar" : 5, "baz" : 10})
.. seealso::
:meth:`touch`
"""
return _Base.touch_multi(self, keys, ttl=ttl)