Updated Getting started (markdown)

master
Bennu 2021-10-19 15:22:00 +08:00
parent 6f55fa4d10
commit b9ab00fece
1 changed files with 30 additions and 0 deletions

@ -180,3 +180,33 @@ await milvusClient.dataManager.search({
});
```
# Querying
This topic describes how to conduct a query.
In addition to vectors, Milvus supports data types such as boolean, integers, floating-point numbers, and more.
A query is a search on all existing data. In Milvus, you can run a query which will return all the results that meet your specified requirements. Use boolean expression to specify the requirements.
In Python
```
expr = "id in [2,4,6,8]"
output_fields = ["id", "vector"]
res = collection.query(expr, output_fields)
# check the results
sorted_res = sorted(res, key=lambda k: k['film_id'])
print(sorted_res)
```
In Node
```
await milvusClient.dataManager.query({
collection_name: COLLECTION_NAME,
expr: "id in [2,4,6,8]",
output_fields: ["id", "vector"],
});
```