milvus-logo
LFAI
< Docs
  • Go

HasPartition()

This method verifies if a partition exists in the specified collection.

Invocation

client.HasPartition(ctx, collName, partName)

Parameters

ParameterDescriptionType
ctxContext to control API invocation processcontext.Context
collNameName of the collection with the partition to checkString
partNameName of the partition to checkString

Return

Boolean value that stands for whether the partition exists or not.

Errors

err: error in the process (if any). Possible errors are listed below:

  • ErrClientNotReady, error that the client is not connected.

  • error that API invocation failed.

Example

hasPar, err := milvusClient.HasPartition(
  context.Background(),
  "book",
  "novel",
)
if err != nil {
  log.Fatal("failed to check the partition:", err.Error())
}
log.Println(hasPar)
Feedback

Was this page helpful?