# Javascript to elasticsearch

**URL:** <https://discuss.elastic.co/t/javascript-to-elasticsearch/223373>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 3:47pm UTC](https://discuss.elastic.co/t/javascript-to-elasticsearch/223373 "2020-03-12T15:47:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhinav\_Gandhi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhinav_gandhi/32/60794_2.png) [@Abhinav\_Gandhi](https://discuss.elastic.co/u/Abhinav_Gandhi)\
**Post date:** [March 12, 2020, 3:47pm UTC](https://discuss.elastic.co/t/javascript-to-elasticsearch/223373/1 "2020-03-12T15:47:24Z")

</div>

I have a javascript AWS lambda which writes to my elastic search cluster. The problem i am facing is that all long values are truncated in javascript because of javascript parsing issues.  
When I parse this little piece of JSON  
{ "value" : 9223372036854775807 }  
that's what I get  
{ hello: 9223372036854776000 }  
One solution is to store values as string however i want to maintain the type as long only.  
What is the other way to handle this ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 9, 2020, 3:47pm UTC](https://discuss.elastic.co/t/javascript-to-elasticsearch/223373/2 "2020-04-09T15:47:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
