Clears the list. Raises: :class:`~couchbase.exceptions.DocumentNotFoundException`: If the list does not already exist.
(self)
| 329 | return list_.content_as[list] |
| 330 | |
| 331 | def clear(self) -> None: |
| 332 | """Clears the list. |
| 333 | |
| 334 | Raises: |
| 335 | :class:`~couchbase.exceptions.DocumentNotFoundException`: If the list does not already exist. |
| 336 | """ |
| 337 | op_type = DatastructureOperationType.ListClear |
| 338 | with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 339 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 340 | kv_op_type = KeyValueOperationType.Remove |
| 341 | with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 342 | try: |
| 343 | req = self._impl.request_builder.build_remove_request(self._key, |
| 344 | obs_handler, |
| 345 | parent_span=ds_obs_handler.wrapped_span) |
| 346 | self._impl.remove(req, obs_handler) |
| 347 | except DocumentNotFoundException: |
| 348 | pass |
| 349 | |
| 350 | def __iter__(self): |
| 351 | list_ = self._get() |
nothing calls this directly
no test coverage detected