Collections
Delete a collection
Permanently remove or recreate collections.
This page explains how to permanently remove a collection or reset it to an empty state.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Permanently remove or recreate collections.
import asyncio
from actian_vectorai import AsyncVectorAIClient
async def main():
# Connect to VectorAI DB server
async with AsyncVectorAIClient("localhost:6574") as client:
# Permanently delete collection
await client.collections.delete("my_collection")
print("Collection deleted")
asyncio.run(main())
import { VectorAIClient } from '@actian/vectorai-client';
async function main() {
// Connect to VectorAI DB server
const client = new VectorAIClient('localhost:6574');
try {
// Permanently delete collection
await client.collections.delete('my_collection');
console.log('Collection deleted');
} finally {
client.close();
}
}
main().catch(console.error);
import asyncio
from actian_vectorai import AsyncVectorAIClient, VectorParams, Distance
async def main():
# Connect to VectorAI DB server
async with AsyncVectorAIClient("localhost:6574") as client:
# Removes all data and recreates with specified configuration
await client.collections.recreate(
"my_collection", # Collection name
vectors_config=VectorParams(size=128, distance=Distance.Cosine) # Vector configuration
)
print("Collection recreated")
asyncio.run(main())
import { VectorAIClient } from '@actian/vectorai-client';
async function main() {
// Connect to VectorAI DB server
const client = new VectorAIClient('localhost:6574');
try {
// Removes all data and recreates with specified configuration
await client.collections.recreate('my_collection', {
dimension: 128, // Vector dimension
distanceMetric: 'COSINE' // Distance metric
});
console.log('Collection recreated');
} finally {
client.close();
}
}
main().catch(console.error);