* Deletes documents from the Chroma database. The documents to be deleted * can be specified by providing an array of `ids` or a `filter` object. * @param params An object containing either an array of `ids` of the documents to be deleted or a `filter` object to specify the documents to be
(params: ChromaDeleteParams<this['FilterType']>)
| 182 | * @returns A promise that resolves when the specified documents have been deleted from the database. |
| 183 | */ |
| 184 | async delete(params: ChromaDeleteParams<this['FilterType']>): Promise<void> { |
| 185 | const collection = await this.ensureCollection() |
| 186 | if (Array.isArray(params.ids)) { |
| 187 | await collection.delete({ ids: params.ids }) |
| 188 | } else if (params.filter) { |
| 189 | await collection.delete({ |
| 190 | where: { ...params.filter } |
| 191 | }) |
| 192 | } else { |
| 193 | throw new Error(`You must provide one of "ids or "filter".`) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Searches for vectors in the Chroma database that are similar to the |
no test coverage detected