This action is irreversible. Proceed with caution.
Deletes the current index and all its associated data from the CyborgDB service.
async deleteIndex(): Promise<null>

Exceptions

Example Usage

import { Client } from 'cyborgdb';

const client = new Client({ baseUrl: 'http://localhost:8000', apiKey: 'your-api-key' });

// Load an existing index
const indexKey = new Uint8Array(Buffer.from('your-stored-hex-key', 'hex'));
const index = await client.loadIndex({ indexName: 'temporary-index', indexKey });

// Delete the index when no longer needed
try {
    const result = await index.deleteIndex();
    console.log('Index deletion result:', result);
    // Possible outputs:
    // { status: 'success', message: "Index 'temporary-index' deleted successfully" }
    // { status: 'success', message: "Index 'temporary-index' was already deleted" }
    
} catch (error) {
    console.error('Failed to delete index:', error.message);
}