Serverless: How to Delete specific records by metadata?

Hi Pinecone Support,

I recently upgraded to the serverless version of Pinecone and encountered an issue with deleting specific vectors. In the free version, I used metadata (UserID and filename) to identify and delete specific vectors, as shown in the following code snippet:

const fileToDelete = user.files.find(file => file.fileid === fileId && file.filename === filename);

// Delete file from Pinecone
const pineconeIndex = pinecone.Index(PINECONE_INDEX_NAME);
const deleteRequest = {
  namespace: PINECONE_NAME_SPACE,
  filter: {
    'userId': { $eq: fileToDelete.userId },
    'filename': { $eq: fileToDelete.filename },
  },
};
await pineconeIndex._delete({ deleteRequest: deleteRequest });

However, I understand from the (Manage RAG documents) that serverless indexes do not support deletion by metadata. Could you please confirm if this is the case? Additionally, I would appreciate any guidance or examples on how to implement record deletion by ID prefix, as suggested in the docs, to achieve similar functionality.

Thank you for your assistance.

Best regards, Robin

1 Like

Hi @rd.intermac, apologies for the late reply!

You are correct that serverless indexes do not support delete by metadata functionality. For a complete list of serverless index limitations, many of which only apply to the ongoing public preview period, please see Limits.

You can find an example of fetching the records by prefix at Fetch all records for a parent document. You can then take the IDs you fetch and Delete specific records by ID.

You may find it helpful to review the List and Delete operations in the API Reference. Let us know if you have any questions!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Pleased to announce that Pinecone now supports delete-by-metadata on all indexes, including Serverless!

Hi folks, one minor clarification on @perry’s comment above:

We’re still migrating some serverless indexes in the AWS us-east-1 and us-west-2 environments. We paused migrations to focus on stability work and general performance improvements, though we have resumed these efforts.

All serverless indexes will soon be migrated to our new architecture that supports delete-by-metadata!