接口定义
def drop_collection(self,database_name: str,collection_name: str,timeout: Optional[float] = None) -> Dict:
使用示例
警告:
执行 drop 操作将会永久删除指定 Collection 下的所有数据。在操作之前,务必谨慎考虑。
说明:
如果您为集合设置了别名,删除集合操作仅支持使用集合的原始名称,无法通过别名来删除对应的集合。
res = client.drop_collection(database_name='db-test', collection_name='book-emb')print(res, flush=True)
入参描述
参数名 | 是否必选 | 参数含义 | 配置方法 |
database_name | 是 | 指定数据库名。 | Database 命名要求如下: 只能使用英文字母,数字,下划线_、中划线-,并以英文字母开头。 长度要求:[1,128]。 |
collection_name | 是 | 指定 Collection 的名称。 | Collection 命名要求如下: 只能使用英文字母,数字,下划线_、中划线-,并以英文字母开头。 长度要求:[1,128]。 |
timeout | 否 | 请求超时时间。 | 单位:秒。 默认值:VectorDBClient() 接口配置的 timeout 时长。 取值范围:大于等于0。 |
出参描述
{'code': 0,'msg': 'operation success','affectedCount': 1}
参数名 | 参数含义 |
affectedCount | 影响行数,即为删除集合数量。 |