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
Attribute | Type | Description |
---|---|---|
collection | string | The name of the collection. |
message GetCollectionInfoArgs {
string collection = 1;
}
Output Message
Name: GetCollectionInfoResult
Attribute | Type | Description |
---|---|---|
name | string | The name of the collection. |
size | uint64 | Number of objects in the collection. |
index_type | IndexType | The type of index used to store the geometries in memory. |
id_type | IDType | The 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)