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

Method append

acouchbase/datastructures.py:130–158  ·  view source on GitHub ↗

Add an item to the end of a list. :param value: The value to append :return: None example:: cb.list_append('a_list', 'hello') cb.list_append('a_list', 'world') .. seealso:: :meth:`map_add`

(self, value: JSONType)

Source from the content-addressed store, hash-verified

128 transcoder=transcoder)
129
130 async def append(self, value: JSONType) -> None:
131 """
132 Add an item to the end of a list.
133
134 :param value: The value to append
135 :return: None
136
137 example::
138
139 cb.list_append('a_list', 'hello')
140 cb.list_append('a_list', 'world')
141
142 .. seealso:: :meth:`map_add`
143 """
144 op_type = DatastructureOperationType.ListAppend
145 async with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
146 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
147 kv_op_type = KeyValueOperationType.MutateIn
148 async with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
149 op = array_append('', value)
150 req = self._impl.request_builder.build_mutate_in_request(self._key,
151 (op,),
152 obs_handler,
153 parent_span=ds_obs_handler.wrapped_span)
154 await self._execute_op(self._impl.mutate_in,
155 req,
156 obs_handler,
157 ds_obs_handler.wrapped_span,
158 create_type=True)
159
160 async def prepend(self, value: JSONType) -> None:
161 """

Callers 4

_execute_opMethod · 0.45
_execute_opMethod · 0.45
_execute_opMethod · 0.45
_execute_opMethod · 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