AlterCollectionFieldAsync()

Alters the properties of a field in an existing collection.

public async Task AlterCollectionFieldAsync(AlterCollectionFieldReq request, CancellationToken cancellationToken = default)

Request Syntax

var request = new AlterCollectionFieldReq
{
    CollectionName = "my_collection",
    FieldName = "title",
    Properties = { { "mmap.enabled", "true" } }
};

await client.AlterCollectionFieldAsync(request);

REQUEST PARAMETERS:

  • DatabaseName (string?) -

    An optional database name to operate on. When empty, the client’s currently selected database is used.

  • CollectionName (string) -

    The name of the collection containing the field to alter.

  • FieldName (string) -

    The name of the field to alter.

  • Properties (IDictionary) -

    The key-value pairs of properties to set on the field. Entries are added via the collection-initializer syntax Properties = { ... }.

  • DeleteKeys (IReadOnlyList?) -

    The keys of properties to remove from the field, if any.

RETURN TYPE:

Task

RETURNS:

This method does not return a value.

EXCEPTIONS:

  • MilvusException

    Thrown when the RPC fails or the server returns an error. Inspect the exception message for details.

Example

using Milvus.Client.V2;
using Milvus.Client.V2.Requests.Collection;

using var client = new MilvusClientV2(new ConnectConfig
{
    Uri = "localhost:19530",
    Username = "root",
    Password = "Milvus"
});
await client.ConnectAsync();

await client.AlterCollectionFieldAsync(new AlterCollectionFieldReq
{
    CollectionName = "my_collection",
    FieldName = "title",
    Properties = { { "mmap.enabled", "true" } }
});

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?