Skip to content

[Bug] Missing type-checking for deleteMany filter argument #103

Open
@PrimeObjects

Description

@PrimeObjects

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this 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
};

    const pinecone = new Pinecone({
            apiKey,
            environment
        });

   const index =  pinecone.index<TPineconeMetadata>(indexName);

    await index.namespace(organizationId).upsert({
        id: "1234",
        values,
        metadata
    });
    
    //deleteMany with filter fails
    await index.namespace(organizationId).deleteMany({
            filter:  {"recordId":"2bb22982-40d4-4156-a1d7-fcf11610e5c3"}
        });
        
     ///deleteMany with array works
     await index.namespace(organizationId).deleteMany(["1234']);

Relevant log output

No response

Environment

- **OS**:
- **Language version**:
- **Pinecone client version**:

Additional Context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions