Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

It should handle int64 properly #226

Closed
shanghaikid opened this issue Aug 21, 2023 · 2 comments
Closed

It should handle int64 properly #226

shanghaikid opened this issue Aug 21, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@shanghaikid
Copy link
Contributor

Describe the feature:
Node doesn't support int64, it will parse int64(defined in the protobuf file) to string. The SDK should handle this situation since most of the fields will not exceed the limit of int32.

@shanghaikid
Copy link
Contributor Author

#279

@shanghaikid
Copy link
Contributor Author

Usage

const longClient = new MilvusClient({
  address: IP,
  loaderOptions: { longs: Function },
});

Data returned:

 {
        json: { string: 'HGa', float: 0.020460665868316408, number: 15222 },
        id: Long { low: 1228037498, high: 1811489737, unsigned: false },
        varChar_array: [ 'Eesfo', 'apple', 'orange', 'O' ],
        int64: Long { low: 996449586, high: 800717565, unsigned: false }
      },
      {
        json: { string: 'orange', float: 0.43789397308881695, number: 4139 },
        id: Long { low: 1305978112, high: 1831617625, unsigned: false },
        varChar_array: [ 'apple', 'QP', 'orange', 'lB8' ],
        int64: Long { low: 897979946, high: 1652577907, unsigned: false }
      },
      {
        json: {},
        id: Long { low: 1527160501, high: 2047027582, unsigned: false },
        varChar_array: [ 'orange', 'T7K7oT', 'w', 'apple' ],
        int64: Long { low: 232075865, high: 1912830474, unsigned: false }
      }

You can use long.js or BigInt to parse the int64 format.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant