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

Method clear

couchbase/datastructures.py:598–612  ·  view source on GitHub ↗

Clears the map.

(self)

Source from the content-addressed store, hash-verified

596 return map_.content_as[dict]
597
598 def clear(self) -> None:
599 """Clears the map.
600 """
601 op_type = DatastructureOperationType.MapClear
602 with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
603 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
604 kv_op_type = KeyValueOperationType.Remove
605 with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
606 try:
607 req = self._impl.request_builder.build_remove_request(self._key,
608 obs_handler,
609 parent_span=ds_obs_handler.wrapped_span)
610 self._impl.remove(req, obs_handler)
611 except DocumentNotFoundException:
612 pass
613
614 def items(self) -> Generator:
615 """Provides mechanism to loop over the entire map.

Callers 14

drainMethod · 0.45
test_listMethod · 0.45
test_mapMethod · 0.45
test_setsMethod · 0.45
test_queueMethod · 0.45
test_kv_ds_listMethod · 0.45
test_kv_ds_mapMethod · 0.45
test_kv_ds_queueMethod · 0.45
test_kv_ds_setMethod · 0.45
test_kv_ds_listMethod · 0.45
test_kv_ds_mapMethod · 0.45

Calls 5

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

Tested by 12

test_listMethod · 0.36
test_mapMethod · 0.36
test_setsMethod · 0.36
test_queueMethod · 0.36
test_kv_ds_listMethod · 0.36
test_kv_ds_mapMethod · 0.36
test_kv_ds_queueMethod · 0.36
test_kv_ds_setMethod · 0.36
test_kv_ds_listMethod · 0.36
test_kv_ds_mapMethod · 0.36
test_kv_ds_queueMethod · 0.36
test_kv_ds_setMethod · 0.36