当前位置: 首页>>代码示例>>Python>>正文


Python Connection.set_multi方法代码示例

本文整理汇总了Python中couchbase._libcouchbase.Connection.set_multi方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.set_multi方法的具体用法?Python Connection.set_multi怎么用?Python Connection.set_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在couchbase._libcouchbase.Connection的用法示例。


在下文中一共展示了Connection.set_multi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_multi

# 需要导入模块: from couchbase._libcouchbase import Connection [as 别名]
# 或者: from couchbase._libcouchbase.Connection import set_multi [as 别名]
    def set_multi(self, keys, ttl=0, format=None):
        """Set multiple keys

        This follows the same semantics as
        :meth:`~couchbase.libcouchbase.Connection.set`

        :param dict keys: A dictionary of keys to set. The keys are the keys
          as they should be on the server, and the values are the values for
          the keys to be stored

        :param int ttl: If specified, sets the expiration value for all
          keys

        :param int format:
          If specified, this is the conversion format which will be used for
          _all_ the keys.

        :return: A :class:`~couchbase.libcouchbase.MultiResult` object, which
          is a `dict` subclass.

        The multi methods are more than just a convenience, they also save on
        network performance by batch-scheduling operations, reducing latencies.
        This is especially noticeable on smaller value sizes.

        .. seealso::

        :meth:`set`

        """
        return _Base.set_multi(self, keys, ttl=ttl, format=format)
开发者ID:sublee,项目名称:couchbase-python-client,代码行数:32,代码来源:libcouchbase.py

示例2: set_multi

# 需要导入模块: from couchbase._libcouchbase import Connection [as 别名]
# 或者: from couchbase._libcouchbase.Connection import set_multi [as 别名]
    def set_multi(self, keys, ttl=0, format=None, persist_to=0, replicate_to=0):
        """Set multiple keys

        This follows the same semantics as
        :meth:`~couchbase.connection.Connection.set`

        :param dict keys: A dictionary of keys to set. The keys are the keys
          as they should be on the server, and the values are the values for
          the keys to be stored.


          From version 1.1.0, `keys` may also be a
          :class:`~couchbase.items.ItemCollection`. If using a dictionary
          variant for item collections, an additional `ignore_cas` parameter
          may be supplied with a boolean value. If not specified, the operation
          will fail if the CAS value on the server does not match the one
          specified in the `Item`'s `cas` field.

        :param int ttl: If specified, sets the expiration value for all
          keys

        :param int format:
          If specified, this is the conversion format which will be used for
          _all_ the keys.

        :param int persist_to: Durability constraint for persistence.
          Note that it is more efficient to use :meth:`endure_multi`
          on the returned :class:`~couchbase.result.MultiResult` than
          using these parameters for a high volume of keys. Using these
          parameters however does save on latency as the constraint checking
          for each item is performed as soon as it is successfully stored.

        :param int replicate_to: Durability constraints for replication.
          See notes on the `persist_to` parameter for usage.

        :return: A :class:`~couchbase.result.MultiResult` object, which
          is a `dict` subclass.

        The multi methods are more than just a convenience, they also save on
        network performance by batch-scheduling operations, reducing latencies.
        This is especially noticeable on smaller value sizes.

        .. seealso:: :meth:`set`

        """
        return _Base.set_multi(self, keys, ttl=ttl, format=format,
                               persist_to=persist_to, replicate_to=replicate_to)
开发者ID:neilalbrock,项目名称:couchbase-python-client,代码行数:49,代码来源:connection.py


注:本文中的couchbase._libcouchbase.Connection.set_multi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。