diff --git a/milvus/grpc/Data.ts b/milvus/grpc/Data.ts index 8bf7a0ed..db498b17 100644 --- a/milvus/grpc/Data.ts +++ b/milvus/grpc/Data.ts @@ -309,6 +309,7 @@ export class Data extends Collection { * @param {string} data.collection_name - The name of the collection. * @param {string} [data.partition_name] - The name of the partition (optional). * @param {string} data.expr - Boolean expression used to filter entities for deletion. + * @param {string} [data.consistency_level] - The consistency level of the new collection. Can be "Strong" (Milvus default), "Session", "Bounded", "Eventually", or "Customized". * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined. * * @returns {Promise} The result of the operation. @@ -355,6 +356,7 @@ export class Data extends Collection { * @param {string} [data.partition_name] - The name of the partition (optional). * @param {(string[] | number[])} [data.ids] - IDs of the entities to delete. * @param {string} [data.filter] - Filter expression, takes precedence over ids. + * @param {string} [data.consistency_level] - The consistency level of the new collection. Can be "Strong" (Milvus default), "Session", "Bounded", "Eventually", or "Customized". * @param {string} [data.expr] - equals to data.filter. * @param {number} [data.timeout] - Optional duration of time in milliseconds to allow for the RPC. If undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined. * diff --git a/milvus/types/Data.ts b/milvus/types/Data.ts index a94a8a8c..1f771873 100644 --- a/milvus/types/Data.ts +++ b/milvus/types/Data.ts @@ -110,20 +110,27 @@ export interface InsertReq extends collectionNameReq { transformers?: InsertTransformers; // provide custom data transformer for specific data type like bf16 or f16 vectors } -export interface DeleteEntitiesReq extends collectionNameReq { +interface BaseDeleteReq extends collectionNameReq { + partition_name?: string; // partition name + consistency_level?: + | 'Strong' + | 'Session' + | 'Bounded' + | 'Eventually' + | 'Customized'; // consistency level +} + +export interface DeleteEntitiesReq extends BaseDeleteReq { filter?: string; // filter expression expr?: string; // alias for filter - partition_name?: string; // partition name } -export interface DeleteByIdsReq extends collectionNameReq { +export interface DeleteByIdsReq extends BaseDeleteReq { ids: string[] | number[]; // primary key values - partition_name?: string; // partition name } -export interface DeleteByFilterReq extends collectionNameReq { +export interface DeleteByFilterReq extends BaseDeleteReq { filter: string; // filter expression - partition_name?: string; // partition name } export type DeleteReq = DeleteByIdsReq | DeleteByFilterReq; diff --git a/test/grpc/Data.spec.ts b/test/grpc/Data.spec.ts index 74be5790..701d6919 100644 --- a/test/grpc/Data.spec.ts +++ b/test/grpc/Data.spec.ts @@ -537,6 +537,7 @@ describe(`Data.API`, () => { await milvusClient.deleteEntities({ collection_name: COLLECTION_NAME, expr: 'id in [2,6]', + consistency_level: 'Strong', }); const res = await milvusClient.query({