Get all vectors ids based on metadata filter for deletion in serverless

as per this doc Manage RAG documents - Pinecone Docs

const index = pc.index('my-index').namespace('my-namespace');

const pageOneList = await index.listPaginated({ prefix: 'doc1#' });
const pageOneVectorIds = pageOneList.vectors.map((vector) => vector.id);

whats the process to do metadata based filter like year, genre on listPaginated() function without using prefix ?

1 Like

@sundi133 ,

Thanks for reaching out on the Pinecone Community Forum. You cannot apply metadata filters to the list operation.

One approach for deleting vectors by metadata is to query for the IDs using a filter and then batch delete the retrieved IDs. Please look at Handle large numbers of deletes by metadata for more details on how to do this, and note that this is an imperfect workaround.

In addition, we expect to support delete-by-metadata on serverless indexes in the coming months.

2 Likes