I am trying to delete all the data points that are associated with a particular email Id, but I am encountering the following error.
source code:
app.get('/cleanUpResources', async (req, res) => {
const _id = req.query.email;
const embeddings = new VertexAIEmbeddings({
model: "text-embedding-004",
});
const vectorStore = await QdrantVectorStore.fromExistingCollection(embeddings, {
url: <url>,
apiKey: <api-key>,
collectionName: 'pdf-docs',
});
// Delete all points with payload field 'id' equal to req.body.email
await vectorStore.delete({
filter: {
must: [
{
key: "id",
match: { value: JSON.stringify(_id) },
},
],
},
});
return res.json({ message: `Deleted all points with id: ${id}` });
})
Error:
Error: Bad Request
at Object.fun [as deletePoints] (file:///C:/Users/abhis/OneDrive/Desktop/PROJECTS/PDF-RAG/server/node_modules/@qdrant/openapi-typescript-fetch/dist/esm/fetcher.js:169:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async QdrantClient.delete (file:///C:/Users/abhis/OneDrive/Desktop/PROJECTS/PDF-RAG/server/node_modules/@qdrant/js-client-rest/dist/esm/qdrant-client.js:628:26)
at async QdrantVectorStore.delete (file:///C:/Users/abhis/OneDrive/Desktop/PROJECTS/PDF-RAG/server/node_modules/@langchain/qdrant/dist/vectorstores.js:140:13)
at async file:///C:/Users/abhis/OneDrive/Desktop/PROJECTS/PDF-RAG/server/app.js:73:5
qDrant DB Collection structure:
metadata: {
"source":"uploads\1753380027445-401326695-CT20244465298_Appl…"
"pdf":{}
"loc":{}
"id":"<email_address>"
}
I have also gone through the documentation but not able to debug this. https://v03.api.js.langchain.com/classes/_langchain_qdrant.QdrantVectorStore.html#delete
https://qdrant.tech/documentation/concepts/points/#delete-points