Skip to content

Commit 8343f07

Browse files
authored
docs(langchain-redis): add delete documents by IDs documentation (#8960)
1 parent 2794874 commit 8343f07

File tree

1 file changed

+35
-4
lines changed
  • docs/core_docs/docs/integrations/vectorstores

1 file changed

+35
-4
lines changed

docs/core_docs/docs/integrations/vectorstores/redis.ipynb

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"id": "dcf1b905",
180180
"metadata": {},
181181
"source": [
182-
"Top-level document ids and deletion are currently not supported."
182+
"Top-level document ids are currently not supported, but you can delete documents by providing their IDs directly to the vector store."
183183
]
184184
},
185185
{
@@ -304,9 +304,19 @@
304304
"id": "069f1b5f",
305305
"metadata": {},
306306
"source": [
307-
"## Deleting an index\n",
307+
"## Deleting documents\n",
308308
"\n",
309-
"You can delete an entire index with the following command:"
309+
"You can delete documents from the vector store in two ways:\n"
310+
]
311+
},
312+
{
313+
"cell_type": "markdown",
314+
"id": "dde32a56",
315+
"metadata": {},
316+
"source": [
317+
"### Delete all documents\n",
318+
"\n",
319+
"You can delete an entire index and all its documents with the following command:"
310320
]
311321
},
312322
{
@@ -319,6 +329,27 @@
319329
"await vectorStore.delete({ deleteAll: true });"
320330
]
321331
},
332+
{
333+
"cell_type": "markdown",
334+
"id": "b77fa077",
335+
"metadata": {},
336+
"source": [
337+
"### Delete specific documents by ID\n",
338+
"\n",
339+
"You can also delete specific documents by providing their IDs. Note that the configured key prefix will be automatically added to the IDs you provide:\n"
340+
]
341+
},
342+
{
343+
"cell_type": "code",
344+
"execution_count": 11,
345+
"id": "cb7a85ee",
346+
"metadata": {},
347+
"outputs": [],
348+
"source": [
349+
"// The key prefix will be automatically added to each ID\n",
350+
"await vectorStore.delete({ ids: [\"doc1\", \"doc2\", \"doc3\"] });\n"
351+
]
352+
},
322353
{
323354
"cell_type": "markdown",
324355
"id": "bf2357b3",
@@ -331,7 +362,7 @@
331362
},
332363
{
333364
"cell_type": "code",
334-
"execution_count": 11,
365+
"execution_count": 12,
335366
"id": "48a98cba",
336367
"metadata": {},
337368
"outputs": [],

0 commit comments

Comments
 (0)