milvus-io / milvus-sdk-node

The Official Mivus node.js sdk(client)
https://milvus.io
Apache License 2.0
122 stars 37 forks source link

queryIterator limit field is not documented properly #360

Open teynar opened 1 week ago

teynar commented 1 week ago

According to this README.md:

limit: total, // optional, how much data do you want to fetch, if not set, fetch all the data, be careful if you have large data set

https://github.com/milvus-io/milvus-sdk-node/blame/9d4cc1beb11b554902bc57c2d96f9c817b0aff58/README.md#L72-L94

It says this field is optional, but in reality, it is currently required as shown here:

https://github.com/milvus-io/milvus-sdk-node/blob/9d4cc1beb11b554902bc57c2d96f9c817b0aff58/milvus/types/Data.ts#L419-L423

In the Python SDK, if the limit is set to -1, then it means that there is no limit to the query operation.

Therefore I believe that this should be done:

Optionally set an exported constant for the -1 value (NO_LIMIT) for users to use which is considered in the typescript type

And do one of these options: a) Update this piece of documentation and state that -1 means "no limit", refer to the constant if it exists b) Allow the limit field to be not defined and default to -1 as "no limit", refer to the constant if it exists

shanghaikid commented 1 week ago

you are right, my bad, I will fix this tomorrow.