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

delete

Last update:
May 18, 2026

Description

Deletes a single item from the vector store identified by its ID.

Syntax

vectorStoreClient.delete(id)

Returns

Void

Parameters

Parameter
Type
Required
Description
id
String
Yes
The unique identifier of the item to delete.

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