import { Pinecone } from ‘@pinecone-database/pinecone’;
const pinecone = new Pinecone({
apiKey: process.env.PINECONE_API_KEY,
environment: process.env.PINECONE_ENVIRONMENT,
});
const index = pinecone.index(‘test1’);
await index.deleteAll();
Error:
SyntaxError: Invalid or unexpected token
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:68:21)
If you want to keep the index the exact same and not have to re-setup a new Index each time which requires startup times, a couple of clicks, and config setup, you can reset your entire Index in a click with VectorAdmin (open-source vector database management tool).
Its under the tools section and works with all tiers of Pinecone. I had this same frustration at one point