Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Class Collections

    Collections preserve snapshots of pod-based indexes. Access them through Pinecone.collections; do not construct this class directly. Use Backups for index backups instead of pod-based collections.

    import { Pinecone } from '@pinecone-database/pinecone';

    const pc = new Pinecone();
    const collections = await pc.collections.list();
    Index
    • Deletes a collection.

      Parameters

      • collectionName: string

        The collection name, such as catalog-snapshot.

      Returns Promise<void>

      Resolves when the deletion request succeeds.

      Errors.PineconeArgumentError when the collection name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      await pc.collections.delete('catalog-snapshot');
    • Retrieves the metadata and status of a collection.

      Parameters

      • collectionName: string

        The collection name, such as catalog-snapshot.

      Returns Promise<CollectionModel>

      The collection status, size, dimension, and record count.

      Errors.PineconeArgumentError when the collection name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const collection = await pc.collections.describe('catalog-snapshot');
      console.log(collection.status);
    • Lists all collections in the project.

      Returns Promise<CollectionList>

      The collections and their current status.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const result = await pc.collections.list();
      console.log(result.collections);