I'm struggling with numeric type precision differences between Javascript and Elasticsearch. I'm having a date property that is optional, and for some documents is undefined. While searching for documents in descending order of that date, when I reach the part where the date is undefined, the sort property of response has the following value:
"sort": [-9223372036854775808, "some tie-breaker uuid"]
I know that in Javascript this value is modified to the closest numeric value, but it is not a problem because I know what value I should pass. When I try to work around it by passing it as a string to search_after I receive parse_exception but when it is passed as a number (in Postman, not in JS client), everything is fine.
How to pass the minimum long value as a timestamp when Javascript doesn't allow to store such value, and strings are not accepted?
Thanks for any hints!