From b9ab00fece51a8851a7b585ad05d4faf919b1434 Mon Sep 17 00:00:00 2001 From: Bennu Date: Tue, 19 Oct 2021 15:22:00 +0800 Subject: [PATCH] Updated Getting started (markdown) --- Getting-started.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Getting-started.md b/Getting-started.md index e7cbc29..57f3403 100644 --- a/Getting-started.md +++ b/Getting-started.md @@ -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"], +}); +``` +