N8n Qdrant Delete Points Node not working?

Describe the problem/error/question

Hi,

I am trying to delete points in my Qdrant collection based on payload/metadata filter.

What is the error message (if any)?

{ "status": { "error": "Format error in JSON body: data did not match any variant of untagged enum PointsSelector" }, "time": 0 }

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“resource”: “point”,
“operation”: “deletePoints”,
“collectionName”: {
“__rl”: true,
“value”: “Test2”,
“mode”: “list”,
“cachedResultName”: “Test2”
},
“filter”: “={\n "filter": {\n "must": [\n {\n "key": "File path",\n "match": {\n "value": "{{ $(‘Handle File Event’).item.json.file_deleted }}"\n }\n }\n ]\n }\n}”,
“ordering”: “strong”,
“requestOptions”: {}
},
“type”: “n8n-nodes-qdrant.qdrant”,
“typeVersion”: 1,
“position”: [
340,
-760
],
“id”: “443eaa63-51b2-4b45-a0b6-8a58910bab9c”,
“name”: “Delete Points”,
“credentials”: {
“qdrantRestApi”: {
“id”: “Q0Lpme1N5Hk3TlKr”,
“name”: “Qdrant account”
}
}
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a”
}
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.99.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: MacOS

Please share the input for the node, more specifically what’s the value of
$('Handle File Event').item.json.file_deleted.

Sorry… it is a path way meta data. And I checked the qdrant dashboard that the input is there. I am deleting all the points related to that file.

I got the workflow template from n8n by Jim Leuk. Modified it to the delete points based on metadata filter.

Try to change the key to something like
"key": "\"File path\""

I believe the issue could be due to the space in the key.

Thanks Jabbson, you method got it running. I understand what you mean. So it’s a good practice to add “_” instead of space right?

Now I got another problem, it doesn’t delete the Qdrant related points in the collection.

The above is one of the many points. I cannot delete the points based on the metadata filter.


The json body I used based on qdrant document.

Is there any output to not being able to delete?

exactly the same point deletes for me just fine:

The point

The filter:

{
  "must": [{
    "key": "document_type",
    "match": {
      "value": "Light novel"
    }
  }]
}

The result:

[
  {
    "result": {
      "operation_id": 15,
      "status": "completed"
    },
    "status": "ok",
    "time": 0.000865033
  }
]

My apology, I am beginner in coding and vector store.

I wonder why the UI for your Qdrant dashboard is different from mine.

In n8n it shows that the process completed but when I access the dashboard nothing is deleted. Since I only insert one documents, all the points should be deleted. But the collection still show a full 635 points.

I wonder if my setup is correct. I use the n8n self hosted ai starter kit with docker compose to set up this.

I have heavily modified version of that as well, but I really don’t think this is the reason. Double check if you are deleting from the right collection, check if the same filter works from the qdrant console… honestly, idk what else this could be…

Ah, wait a second, let me try something…

Yep, you have a bit different structure of the point. Your filter needs to be

{
  "must": [{
    "key": "metadata.document_type",
    "match": {
      "value": "Light novel"
    }
  }]
}

Note that metadata.document_type type, which is different from the previous filter I shared.

I tried nothing got deleted. :sad_but_relieved_face:

Even tried the Qdrant console. Status is acknowledged. But nothing changed.

Fyi, the collection is created automatically by the vector store (let me know if you wanna see the config info for the collection). I tried to create the collection first, but when when I want to insert to that collection I created manually. Nothing happen as well.

Wonder why is the point structure different?

The structure was different because when I was replicating your structure I missed an extra object metadata, it now has metadata as well.

I still have a long way to go. I planned to implement a contextual hybrid search RAG. And I still stuck at the beginning, cannot even interact with the database correctly.

Hi Jabbson, I analyse the config file and realise that there is a difference between an autogenerated vector and a vector defined manually set up as below:

Autogenerated:

Manual (create collection using console)

Currently the Test2 collection is autogenerated by the vector store. Is that the reason why I could update properly?

Please take your time to reply me. Sorry for taking your time especially during the weekends. Thanks