Skip to content

Commit

Permalink
deprecate alterCollection, use alterCollectionProperties instead (#390)
Browse files Browse the repository at this point in the history
Signed-off-by: shanghaikid <[email protected]>
  • Loading branch information
shanghaikid authored Dec 21, 2024
1 parent f8c9766 commit bbea296
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion milvus/grpc/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ export class Collection extends Database {
* });
* ```
*/
async alterCollection(data: AlterCollectionReq): Promise<ResStatus> {
async alterCollectionProperties(
data: AlterCollectionReq
): Promise<ResStatus> {
checkCollectionName(data);

const req: any = {
Expand All @@ -337,6 +339,11 @@ export class Collection extends Database {
return promise;
}

/**
* @deprecated Use alterCollectionProperties instead.
*/
alterCollection = this.alterCollectionProperties;

/**
* Drops collection properties.
* Note that this operation only deletes the properties of the collection, not the collection itself.
Expand Down
4 changes: 2 additions & 2 deletions test/grpc/Collection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ describe(`Collection API`, () => {
const key = 'collection.ttl.seconds';
const value = 18000;

const alter = await milvusClient.alterCollection({
const alter = await milvusClient.alterCollectionProperties({
collection_name: LOAD_COLLECTION_NAME,
properties: { [key]: value },
});
Expand All @@ -417,7 +417,7 @@ describe(`Collection API`, () => {
const key2 = 'mmap.enabled';
const value2 = true;

const alter2 = await milvusClient.alterCollection({
const alter2 = await milvusClient.alterCollectionProperties({
collection_name: LOAD_COLLECTION_NAME,
properties: { [key2]: value2 },
});
Expand Down
2 changes: 1 addition & 1 deletion test/grpc/Database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe(`Database API`, () => {
);

// alterCollection
const alterCollection = await milvusClient.alterCollection({
const alterCollection = await milvusClient.alterCollectionProperties({
collection_name: COLLECTION_NAME2,
db_name: DB_NAME2,
properties: { 'collection.segment.rowLimit': 10000 },
Expand Down

0 comments on commit bbea296

Please sign in to comment.