删除 Collection

最近更新时间:2024-09-29 15:47:41

我的收藏

接口定义

dropCollection()用于删除已创建的 Collection。
public void dropCollection(String collectionName)

使用示例

警告:
执行 drop 操作将会永久删除指定 Collection 下的所有数据。在操作之前,务必谨慎考虑。
// link database, client 为 VectorDBClient() 创建的客户端对象
Database db = client.database("db-test");
// drop
db.dropCollection("book-vector");

入参描述

参数名
是否必选
参数含义
配置方法
collectionName
所需删除的 Collection 名称。
Collection 命名要求如下:
只能使用英文字母,数字,下划线_、中划线-,并以英文字母开头。
长度要求:[1,128]。

出参描述

res: AffectRes{affectedCount=1, code=0, msg='operation success'}
参数名
参数含义
affectedCount
影响行数,即为删除的集合数量。