def delete(self, key, cas=0, quiet=None): """Remove the key-value entry for a given key in Couchbase. :param key: A string which is the key to delete. The format and type of the key follows the same conventions as in :meth:`set` :type key: string, dict, or tuple/list :param int cas: The CAS to use for the removal operation. If specified, the key will only be deleted from the server if it has the same CAS as specified. This is useful to delete a key only if its value has not been changed from the version currently visible to the client. If the CAS on the server does not match the one specified, an exception is thrown. :param boolean quiet: Follows the same semantics as `quiet` in :meth:`get` :raise: :exc:`couchbase.exceptions.NotFoundError` if the key does not exist on the bucket :raise: :exc:`couchbase.exceptions.KeyExistsError` if a CAS was specified, but the CAS on the server had changed :raise: :exc:`couchbase.exceptions.ConnectError` if the connection was closed :return: A :class:`~couchbase.libcouchbase.Result` object. Simple delete:: ok = cb.delete("key").success Don't complain if key does not exist:: ok = cb.delete("key", quiet=True) Only delete if CAS matches our version:: rv = cb.get("key") cb.delete("key", cas=rv.cas) Remove multiple keys:: oks = cb.delete_multi(["key1", "key2", "key3"]) Remove multiple keys with CAS:: oks = cb.delete({ "key1" : cas1, "key2" : cas2, "key3" : cas3 }) .. seealso:: :meth:`delete_multi` """ return _Base.delete(self, key, cas, quiet)