MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / contains

Method contains

acouchbase/datastructures.py:803–817  ·  view source on GitHub ↗

Check whether or not the CouchbaseSet contains a value :param value: Value to remove :return: True if `value` exists in the set, False otherwise .. seealso:: :meth:`set_add`, :meth:`map_add`

(self, value: Any)

Source from the content-addressed store, hash-verified

801 await asyncio.sleep(interval_millis / 1000)
802
803 async def contains(self, value: Any) -> bool:
804 """
805 Check whether or not the CouchbaseSet contains a value
806
807 :param value: Value to remove
808 :return: True if `value` exists in the set, False otherwise
809
810 .. seealso:: :meth:`set_add`, :meth:`map_add`
811 """
812 op_type = DatastructureOperationType.SetContains
813 async with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
814 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
815 sd_res = await self._get(parent_span=ds_obs_handler.wrapped_span)
816 list_ = sd_res.content_as[list]
817 return value in list_
818
819 async def size(self) -> int:
820 """

Callers 3

test_setsMethod · 0.45
test_kv_ds_setMethod · 0.45
test_kv_ds_setMethod · 0.45

Calls 4

_getMethod · 0.95
get_details_as_dictMethod · 0.80
create_kv_spanMethod · 0.45

Tested by 3

test_setsMethod · 0.36
test_kv_ds_setMethod · 0.36
test_kv_ds_setMethod · 0.36