跳到主要内容

获取 Entity

Gets entities by the specified IDs. You can set an ID in string or integer or set a set of IDs in a list of strings or a list of integers as shown in the four types of request bodies below.

POST
/v1/vector/get
集群 Endpoint

该 API 的 Base URL 格式如下:

https://${CLUSTER_ENDPOINT}

📘说明
export CLUSTER_ENDPOINT=""
参数
Authorizationstringheaderrequired

认证令牌。应为具备适当权限的 API 密钥或用冒号分隔的用户名和密码,如 username:password

示例值:Bearer {{TOKEN}}
请求体application/json
collectionNamestring必填项

Collection 名称。

partitionNamesarray

Partition 名称列表。设置后,当前操作只会应用到这些分区。如果不设置,当前操作会应用到 Collection 中的所有分区。

[]partitionNamesstring

Partition 名称。

outputFieldsarray

查询结果中要返回的字段列表。

[]outputFieldsstring

字段名称。

idoneOfrequired
(待补充)

An array of IDs of the entities to be retrieved

An array of IDs of the entities to be retrieved

export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/get" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"collectionName": "quick_setup",
"id": [
1,
3,
5
],
"outputFields": [
"color"
]
}'
响应200 - application/json
codeinteger

响应码。

dataarray

查询结果。

[]dataobject

An entity object.

Returns an error message.

codeinteger

响应码。

messagestring

错误描述。

{
"code": 200,
"data": [
{
"color": "red_7025",
"id": 1
},
{
"color": "pink_9298",
"id": 3
},
{
"color": "yellow_4222",
"id": 5
}
]
}