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

Method size

acouchbase/datastructures.py:819–843  ·  view source on GitHub ↗

Get the number of items in the set. :return int: The number of items in the map .. seealso:: :meth:`map_add`

(self)

Source from the content-addressed store, hash-verified

817 return value in list_
818
819 async def size(self) -> int:
820 """
821 Get the number of items in the set.
822
823 :return int: The number of items in the map
824
825 .. seealso:: :meth:`map_add`
826 """
827 op_type = DatastructureOperationType.SetSize
828 async with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
829 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
830 kv_op_type = KeyValueOperationType.LookupIn
831 async with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
832 op = count('')
833 req, transcoder = self._impl.request_builder.build_lookup_in_request(self._key,
834 (op,),
835 obs_handler,
836 parent_span=ds_obs_handler.wrapped_span) # noqa: E501
837 sd_res: LookupInResult = await self._execute_op(self._impl.lookup_in,
838 req,
839 obs_handler,
840 ds_obs_handler.wrapped_span,
841 create_type=True,
842 transcoder=transcoder)
843 return sd_res.value[0].get('value', None)
844
845 async def clear(self) -> None:
846 """

Callers

nothing calls this directly

Calls 7

_execute_opMethod · 0.95
countFunction · 0.90
get_details_as_dictMethod · 0.80
create_kv_spanMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected