milvus-logo
LFAI
< Docs
  • C#

InsertAsync()

Inserts rows of data into a collection.

Invocation

await collection.InsertAsync(data, partitionName = null, cancellationToken = default);

Parameters

ParameterDescriptionTypeRequired
dataThe field data to insert; each field contains a list of row values.IReadOnlyList<FieldData>True
partitionNameAn optional name of a partition to insert into.string?False
cancellationTokenThe token to monitor for cancellation requests. The default value is CancellationToken.None.CancellationTokenFalse

Return

This method does not return any value.

Example

await milvusClient.GetCollection("book").InsertAsync(new FieldData[]
{
    FieldData.Create("book_id", bookIds),
    FieldData.Create("word_count", wordCounts),
    FieldData.CreateFloatVector("book_intro", bookIntros)
});
Feedback

Was this page helpful?