def replace(self,
                id,  # type: str
                value,  # type: Any
                *options,
                **kwargs
                ):
        # type: (...)->MutationResult
        """Store an object in Couchbase only if it already exists.

           Follows the same conventions as :meth:`upsert`, but the value is
           stored only if a previous value already exists.

           :raise: :exc:`.NotFoundError` if the key does not exist

           .. seealso:: :meth:`upsert`
        """

        final_options = forward_args(kwargs, *options)
        return ResultPrecursor(_Base.replace(self.bucket, id, value, **final_options), final_options)
Пример #2
0
 def replace(self, key, value, *args, **kwargs):
     return _Base.replace(self, key, value, *args, **kwargs)