ListIndexes()
Returns the names of the indexes on a collection.
pub async fn list_indexes(&self, request: ListIndexesRequest) -> Result<ListIndexesResponse>
Request Syntax
let request = ListIndexesRequest::builder()
.collection_name("books")
.build()?;
REQUEST FIELDS:
database_name: Option<String>Name of the target database; uses the default database when empty.
collection_name: StringName of the collection whose indexes to list. Required.
field_name: StringName of the indexed field; filters the result to indexes on this field.
index_name: StringName of the index to locate.
timestamp: u64Timestamp (in microseconds) used to locate the index metadata at a point in time.
RETURNS:
Result
ListIndexesResponse exposes index_names() returning the names of the indexes on the collection. Returns an Error on failure.
Example
let request = ListIndexesRequest::builder()
.collection_name("books")
.build()?;
let resp = client.list_indexes(request).await?;
for name in resp.index_names() {
println!("index: {}", name);
}