0

Delete All Vectors

by
Published Apr 18, 2023
Script pinecone Verified

The script

Submitted by hugo989 Bun
Verified 6 days ago
1
import { PineconeClient } from "@pinecone-database/[email protected]";
2

3
type Pinecone = {
4
  apiKey: string;
5
  environment: string;
6
};
7
export async function main(
8
  auth: Pinecone,
9
  index_name: string,
10
  namespace?: string,
11
) {
12
  const client = new PineconeClient();
13
  await client.init(auth);
14
  const index = client.Index(index_name);
15

16
  return await index.delete1({
17
    deleteAll: true,
18
    namespace,
19
  });
20
}
21

Other submissions
  • Submitted by adam186 Deno
    Created 398 days ago
    1
    import { PineconeClient } from "npm:@pinecone-database/pinecone";
    2
    
    
    3
    type Pinecone = {
    4
      apiKey: string;
    5
      environment: string;
    6
    };
    7
    export async function main(
    8
      auth: Pinecone,
    9
      index_name: string,
    10
      namespace?: string,
    11
    ) {
    12
      const client = new PineconeClient();
    13
      await client.init(auth);
    14
      const index = client.Index(index_name);
    15
    
    
    16
      return await index.delete1({
    17
        deleteAll: true,
    18
        namespace,
    19
      });
    20
    }
    21