跳转到主要内容
Chroma 支持使用 .delete 通过 id 从集合中删除项目。与每个项目关联的嵌入(embeddings)、文档和元数据都将被删除。
显而易见,这是一个破坏性操作,且无法撤销。
collection.delete(
    ids=["id1", "id2", "id3",...],
)
.delete 还支持 where 过滤器。如果未提供 ids,它将删除集合中所有匹配 where 过滤器的项目。
collection.delete(
    ids=["id1", "id2", "id3",...],
	where={"chapter": "20"}
)