-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Missing type-checking for deleteMany filter argument #103
Comments
I think your filter expression is invalid. You can see some docs about filter expressions here. I think what you need to write is along these lines, without the top-level await index.namespace(organizationId).deleteMany({
recordId: '2bb22982-40d4-4156-a1d7-fcf11610e5c3'
}); It's on my todo list to add better typing around these filter expressions. |
Thanks, that was my issue. |
Glad that unblocked you. I have some promising work-in-progress on adding type-safety to these filter expressions, but I've paused it to prioritize showstopper bugs (e.g. typescript compilation problems) for the next incremental release. Hopefully I'll get that type safety improvement out sometime in the next couple weeks. |
Yes, I just updated to the new 1 version, and I got this error: illegal condition for field filter, got {"knowledgeId":{"$eq":"xxx"},"type":{"$eq":"xxx"},"workspaceId":{"$eq":"xxx"}} And we just had to remove the filter: {xxx} object Also, the documentation is not updated with these changes, it's still using the old methodology https://docs.pinecone.io/docs/metadata-filtering#deleting-vectors-by-metadata-filter |
Is this a new bug?
Current Behavior
await index.namespace(organizationId).deleteMany({
filter: {"recordId":"2bb22982-40d4-4156-a1d7-fcf11610e5c3"}
});
got error below:
{
error: PineconeBadRequestError: illegal condition for field filter, got {"recordId":"2bb22982-40d4-4156-a1d7-fcf11610e5c3"}
at mapHttpStatusError (D:\EncodeChat\encodechat-lambda\encodechat-lambda-vectordb\node_modules@pinecone-database\pinecone\src\errors\http.ts:99:14)
at (D:\EncodeChat\encodechat-lambda\encodechat-lambda-vectordb\node_modules@pinecone-database\pinecone\src\errors\handling.ts:37:32)
at step (D:\EncodeChat\encodechat-lambda\encodechat-lambda-vectordb\node_modules@pinecone-database\pinecone\dist\errors\handling.js:33:23)
at Object.next (D:\EncodeChat\encodechat-lambda\encodechat-lambda-vectordb\node_modules@pinecone-database\pinecone\dist\errors\handling.js:14:53)
at fulfilled (D:\EncodeChat\encodechat-lambda\encodechat-lambda-vectordb\node_modules@pinecone-database\pinecone\dist\errors\handling.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
Expected Behavior
deleteMany wsuccessfully.
Steps To Reproduce
type TPineconeMetadata = {
entityName: string;
entityType: string;
recordId: string;
ownerIds: string[];
organizationId: string;
solutionId: string;
userId: string;
text: string;
};
const metadata: TPineconeMetadata = {
entityName,
entityType,
recordId: "2bb22982-40d4-4156-a1d7-fcf11610e5c3",
ownerIds: ["2bb22982-40d4-4156-a1d7-fcf11610e5c3"],
organizationId,
solutionId,
userId,
text
};
Relevant log output
No response
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: