Whatever message this page gives is out now! Go check it out!

deleteAll

Last update:
May 18, 2026

Description

Deletes items from the vector store. It can be used in three ways: deleting specific IDs, deleting items matching a metadata filter, or deleting all items in the collection.

Syntax

vectorStoreClient.deleteAll(ids)
vectorStoreClient.deleteAll(filter)
vectorStoreClient.deleteAll()

Returns

Void

Parameters

Parameter
Type
Required
Description
id
Array
No
A list of specific IDs to delete.
filter
Struct
No
A metadata filter struct (see search for operators). Deletes all items matching the criteria.
(None)
-
No
If no argument is provided, all items in the store are deleted.

Example

<cfscript>
    try{
        vs = VectorStore({
            provider: "inmemory",
            embeddingModel: {
                "provider": "openai",
                "modelName": "text-embedding-3-small",
                "apiKey": "#application.apiKey#"
            }
        });
        id1 = vs.add({
        "text": "Temporary row",
        "metadata": { "batch": "test-2026-03", "status": "draft" }
    });

    vs.delete(id1);

    vs.addAll([
        {
            "text": "Keep me",
            "metadata": { "env": "prod", "retain": true }
        },
        {
            "text": "Remove me",
            "metadata": { "env": "prod", "retain": false }
        }
    ]);

    vs.deleteAll({ "retain": false, "env": "prod" });

    // vs.deleteAll(); // removes everything in this store — uncomment only when intended
    }
    catch(any e){
        writeOutput("Error initializing VectorStore client:<br><br> ");
        writedump(e.detail);
    }
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page