Skip to content

Commit

Permalink
fix: delete entities when the primary key is string (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Yicai Yu <[email protected]>
  • Loading branch information
yuyicai authored Aug 2, 2023
1 parent a1dd6c8 commit 2feccb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion milvus/grpc/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ export class Data extends Collection {

const pkField = await this.getPkFieldName(data);

const req = { ...data, expr: `${pkField} in [${data.ids.join(',')}]` };
// generate expr by different type of ids
const expr =
typeof data.ids[0] === "string"
? `${pkField} in ["${data.ids.join('","')}"]`
: `${pkField} in [${data.ids.join(",")}]`;
const req = { ...data, expr };
return this.deleteEntities(req);
}

Expand Down

0 comments on commit 2feccb4

Please sign in to comment.