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

Method clear

couchbase/datastructures.py:831–845  ·  view source on GitHub ↗

Clears the set.

(self)

Source from the content-addressed store, hash-verified

829 return sd_res.value[0].get('value', None)
830
831 def clear(self) -> None:
832 """Clears the set.
833 """
834 op_type = DatastructureOperationType.SetClear
835 with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
836 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
837 kv_op_type = KeyValueOperationType.Remove
838 with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
839 try:
840 req = self._impl.request_builder.build_remove_request(self._key,
841 obs_handler,
842 parent_span=ds_obs_handler.wrapped_span)
843 self._impl.remove(req, obs_handler)
844 except DocumentNotFoundException:
845 pass
846
847 def values(self) -> List[Any]:
848 """Returns a list of all the values which exist in the set.

Callers

nothing calls this directly

Calls 5

get_details_as_dictMethod · 0.80
build_remove_requestMethod · 0.80
create_kv_spanMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected