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

Method append

couchbase/datastructures.py:136–157  ·  view source on GitHub ↗

Add an item to the end of the list. Args: value (JSONType): The value to add.

(self, value: JSONType)

Source from the content-addressed store, hash-verified

134 transcoder=transcoder)
135
136 def append(self, value: JSONType) -> None:
137 """Add an item to the end of the list.
138
139 Args:
140 value (JSONType): The value to add.
141
142 """
143 op_type = DatastructureOperationType.ListAppend
144 with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
145 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
146 kv_op_type = KeyValueOperationType.MutateIn
147 with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
148 op = array_append('', value)
149 req = self._impl.request_builder.build_mutate_in_request(self._key,
150 (op,),
151 obs_handler,
152 parent_span=ds_obs_handler.wrapped_span)
153 self._execute_op(self._impl.mutate_in,
154 req,
155 obs_handler,
156 ds_obs_handler.wrapped_span,
157 create_type=True)
158
159 def prepend(self, value: JSONType) -> None:
160 """Add an item to the beginning of the list.

Callers 15

base_versionMethod · 0.45
create_cmake_configMethod · 0.45
setup.pyFile · 0.45
__repr__Method · 0.45
_decode_valueMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45

Calls 6

_execute_opMethod · 0.95
array_appendFunction · 0.90
get_details_as_dictMethod · 0.80
create_kv_spanMethod · 0.45

Tested by

no test coverage detected