Skip to main content
Version: V1.1.0

deleteCollection - Delete a collection

The deleteCollection() method deletes a specified collection.

info

This API can only be used when connected with SeekdbClient. For more information about SeekdbClient, see SeekdbClient.

Prerequisites

  • You have installed seekdb-js. For more information, see Quick start.

  • You have installed the server mode of seekdb. For more information, see Deploy seekdb by using yum install.

  • You are connected to the database. For more information, see SeekdbClient.

  • The collection to be deleted exists. If the collection does not exist, an error will be returned.

Request parameters

deleteCollection(name: string)
ParameterTypeRequiredDescriptionExample value
namestringYesThe name of the collection to be deleted.my_collection

Request example

import { SeekdbClient } from "seekdb";

// 1. Connect
const client = new SeekdbClient({
host: "127.0.0.1",
port: 2881,
user: "root",
password: "",
database: "test",
});

await client.deleteCollection('my_collection');

Response parameters

None