Description

The "Get Collection Info" endpoint allows you to retrieve a collections information such as name, and size.

Proto Definition


service BGSearch {
    rpc GetCollectionInfo (GetCollectionInfoArgs) returns (GetCollectionInfoResult) {}
}

Input Message

Name: GetCollectionInfoArgs

AttributeTypeDescription
collectionstringThe name of the collection.
message GetCollectionInfoArgs {
  string collection = 1;
}

Output Message

Name: GetCollectionInfoResult

AttributeTypeDescription
namestringThe name of the collection.
sizeuint64Number of objects in the collection.
index_typeIndexTypeThe type of index used to store the geometries in memory.
id_typeIDTypeThe type of ID used for the collection.
message GetCollectionInfoResult {
  string name = 1;
  uint64 size = 2;
  IndexType index_type = 3;
  IDType id_type = 4;
}

Status Code

  • 5: NOT_FOUND if a collection with the provided name does not exist.
  • 0: OK if a collection with the provided name exists and its information returned.

Code Examples

proto::GetCollectionInfoArgs request;
proto::CollectionInfo result;

request.set_collection("Collection name");
stub->getCollectionInfo(&context,request, result);
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.GetCollectionInfoArgs(collection="YOUR_COLLECTION_NAME")
stub.getCollectionInfo(args)