manticoresoftware / manticoresearch-typescript

Official TypeScript client for Manticore Search
MIT License
8 stars 3 forks source link

BigInt Support is not working #9

Closed DiegoAlfa7 closed 6 months ago

DiegoAlfa7 commented 6 months ago

Im using manticoresearch-ts in order to implement a Helper that communicates with the manticore database. In my specific use case, i need to replace some documents based on the manticore id column. But when calling the IndexApi.replace function with the BigInt, a JSON Type error gets thrown, indicating that "BigInts cannot be serialized".

I know that js JSON.stringify does not have native support for bigint types (as BigInt.toJSON is not implemented) but this is something you'd imagine the official Manticore API library for javascript should handle internally.

By now Im trying to implement a solution that involves using the json-bigint javascript dependency, but im worried that i should quit using the official manticoresearch-ts library as it uses JSON.parse and JSON.stringify internally when calling the API methods (such as IndexApi.replace). My thoughts are that just by using json-bigint parse and stringify methods inside the library, the issue will be solved.

image

In other words, there's a bug while sending or recieving bigint values with the API.

sanikolaev commented 6 months ago

Blocked by https://github.com/manticoresoftware/manticoresearch-javascript/issues/17

Nick-S-2018 commented 6 months ago

Added in https://github.com/manticoresoftware/manticoresearch-typescript/commit/906c33252a1395b96c7889a0ffd1c89b548522d8