MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / add_results

Method add_results

couchbase/mutation_state.py:54–85  ·  view source on GitHub ↗

Changes the state to reflect the mutation which yielded the given result. In order to use the result, the `enable_mutation_tokens` option must have been specified in the connection string, _and_ the result must have been successful. :param rvs: One

(self, *rvs,  # type: List[MutationResult]
                    **kwargs  # type: Dict[str, Any]
                    )

Source from the content-addressed store, hash-verified

52 return False
53
54 def add_results(self, *rvs, # type: List[MutationResult]
55 **kwargs # type: Dict[str, Any]
56 ) -> bool:
57 """
58 Changes the state to reflect the mutation which yielded the given
59 result.
60
61 In order to use the result, the `enable_mutation_tokens` option must
62 have been specified in the connection string, _and_ the result
63 must have been successful.
64
65 :param rvs: One or more :class:`~.OperationResult` which have been
66 returned from mutations
67 :param quiet: Suppress errors if one of the results does not
68 contain a convertible state.
69 :return: `True` if the result was valid and added, `False` if not
70 added (and `quiet` was specified
71 :raise: :exc:`~.MissingTokenException` if `result` does not contain
72 a valid token
73 """
74 if not rvs:
75 raise MissingTokenException(message='No results passed')
76 for rv in rvs:
77 mut_token = rv.mutation_token()
78 if not isinstance(mut_token, MutationToken):
79 if kwargs.get('quiet', False) is True:
80 return False
81 raise MissingTokenException(
82 message='Result does not contain token')
83 if not self._add_scanvec(mut_token):
84 return False
85 return True
86
87 def add_all(self, bucket, quiet=False):
88 """

Callers 1

__init__Method · 0.95

Calls 4

_add_scanvecMethod · 0.95
mutation_tokenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected