API Reference

Description

The "Rename Collection" endpoint allows you to update the name of an existing collection.

Proto Definition


service BGSearch {
  rpc RenameCollection  (RenameCollectionArgs)  returns (google.protobuf.Empty) {}
}

Input Message

Name: RenameCollectionArgs

AttributeTypeDescription
collectionstringThe name of the collection, before the rename.
new_namestringThe new name of the collection, after the rename.
message RenameCollectionArgs {
  string collection = 1;
  string new_name = 2;
}

Output Message

Name: google.protobuf.Empty

AttributeTypeDescription

Status Code

  • 5: NOT_FOUND if a collection with the provided name does not exist.
  • 0: OK if the collection has been renamed successfully.

Code Examples

proto::RenameCollectionArgs request;   
proto::EmptyResult response;
  
request.set_collection("COLLECTION NAME");  
request.set_newname("NEW COLLECTION NAME");

stub->renameCollection(&context,request,response);
import bgearch_pb2_grpc #Contains the server functions
import bgsearch_pb2 #Contains the types for the messages and arguments in the .proto file

args = bgsearch_pb2.RenameCollectionArgs(collection1="COLLECTION 1",newName="NEW COLLECTION NAME")
stub.renameCollection(args)