Flush()
This method synchronously stores entities from memory to storage and returns when the operations on every segments are complete.
func (c *GrpcClient) Flush(ctx context.Context, collName string, async bool, opts ...FlushOption) error
Request Parameters
Parameter | Description | Type |
---|---|---|
| Context for the current call to work. |
|
| Name of a collection. |
|
| Whether this operation is asynchronous |
|
Return
Null
Errors
Any error in the execution of the request. Possible errors are as follows:
-
ErrClientNotReady
: The client is not connected to Milvus. -
ErrCollectionNotExists
: The collection with the specified name does not exist. -
The call to this API fails.
Example
// flush
err := mc.Flush(context.Background(), collectionName, false)
if err != nil {
log.Fatal("failed to flush collection:", err.Error())
}