milvus-logo
LFAI
< Docs
  • RESTful
    • v1

Upsert

Inserts one or more entities into a collection.

POST
https://${MILVUS_URI}/v1/vector/upsert

Example

None

Request

Parameters

  • No query parameters required

  • No path parameters required

Request Body

{
    "collectionName": "string",
    "dbName": "string"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring(required)
The name of the collection to which entities will be inserted.
dataobject(required)
An entity object. Note that the keys in the entity should match the collection schema.
{
    "collectionName": "string",
    "data": [],
    "dbName": "string"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring(required)
The name of the collection to which entities will be inserted.
dataarray(required)
An array of entity objects. Note that the keys in an entity object should match the collection schema

Response

Returns the number of inserted entities and an array of their IDs.

Response Bodies

  • Response body if we process your request successfully
{
    "code": 200,
    "data": {
        "upsertCount": "integer"
    }
}
  • Response body if we failed to process your request
{
    "code": integer,
    "message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
dataobject
A data object.
data.upsertCountinteger
The number of inserted entities.
data.upsertIdsarray
An array of the IDs of inserted entities.
messagestring
Indicates the possible reason for the reported error.

Possible Errors

None