milvus-logo
LFAI
< Docs
  • Node

query()

This method conducts a vector query.

Invocation

new milvusClient(MILUVS_ADDRESS).dataManager.query(QueryReq);

Parameters

QueryReq

ParameterDescriptionTypeRequired
collection_nameName of the collection to search onStringTrue
output_fieldsVector or scalar field to be returnedString[]True
expr(optional)Boolean expression to filter the dataStringFalse
partitions_names(optional)An array of the names of the partitions to search on.String[]Talse

Example

new milvusClient(MILUVS_ADDRESS).dataManager.query({
  collection_name: "my_collection",
  expr: "age > 0",
  output_fields: ["age"],
});

Return

// query return
{
  status: { error_code: 'Success', reason: '' },
  data: [
    { age: '434848878802248081' },
    ...999 more items,
  ]
}

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?