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
timeoutAn optional duration of time in millisecond to allow for the RPC. Default is undefinedNumberFalse

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,
  ]
}
Feedback

Was this page helpful?