addField()

This operation adds a sub-field to a struct field schema. Use this to define the inner fields of a struct-type column.

public StructFieldSchema addField(AddFieldReq addFieldReq)

PARAMETERS:

  • addFieldReq (AddFieldReq) -

    An AddFieldReq object defining the sub-field properties.

RETURNS:

StructFieldSchema

EXCEPTIONS:

  • MilvusClientException

    This exception will be raised when any error occurs during this operation.

Example

CreateCollectionReq.StructFieldSchema structField = CreateCollectionReq.StructFieldSchema.builder()
    .name("metadata")
    .build();
structField.addField(AddFieldReq.builder()
    .fieldName("key")
    .dataType(DataType.VarChar)
    .maxLength(128)
    .build());

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?