# \[Pls\]how to use doc to update json object, There is some exception

**URL:** <https://discuss.elastic.co/t/pls-how-to-use-doc-to-update-json-object-there-is-some-exception/16062>\
**Category:** Elasticsearch\
**Created:** [February 28, 2014, 1:53am UTC](https://discuss.elastic.co/t/pls-how-to-use-doc-to-update-json-object-there-is-some-exception/16062 "2014-02-28T01:53:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xjj210130](https://avatars.discourse-cdn.com/v4/letter/x/c5a1d2/32.png) [@xjj210130](https://discuss.elastic.co/u/xjj210130)\
**Post date:** [February 28, 2014, 1:53am UTC](https://discuss.elastic.co/t/pls-how-to-use-doc-to-update-json-object-there-is-some-exception/16062/1 "2014-02-28T01:53:32Z")

</div>

I use update to update json object, this is some wrong.Please help me.

1,I insert a log to es.  
curl -XPOST 'localhost:9200/12/1/3/\_update' -d  
'{"doc":{"price":[{"costprice":1,"icsonprice":1,"name":"1123","pid":1,"pricetype":1,"purchaseprice":1,"shipmentprice":1}],"product":{"status":2330,"type":120}}}'

2: I use api to call update with c++, like the following:  
1007/47/12/\_update  
{"doc":{"price":[{"costprice":10,"icsonprice":10,"name":"1123","pid":10,"pricetype":10,"purchaseprice":18,"shipmentprice":19}]}}

3:This is the wrong message as following:  
[Amanda Sefton] Caught exception while handling client http traffic,  
closing connection [id: 0x3c9f560c, /10.12.194.116:52545 :\>  
/10.12.194.116:9200]  
java.lang.IllegalArgumentException: invalid version format:  
1007/47/12/\_UPDATE

?{"DOC":{"PRICE":[{"COSTPRICE":10,"ICSONPRICE":10,"NAME":"1123","PID":10,"PRICETYPE":10,"PURCHASEPRICE":18,"SHIPMENTPRICE":19}]}}  
at  
org.elasticsearch.common.netty.handler.codec.http.HttpVersion.(HttpVersion.java:102)  
at  
org.elasticsearch.common.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62)  
at  
org.elasticsearch.common.netty.handler.codec.http.HttpRequestDecoder.createMessage.

4: if i use curl like the following, there is no error, it works right.  
curl -XPOST localhost:9200/12/1/3/\_update -d '{  
"doc" : {  
"price" :  
[{"costprice":20,"icsonprice":99,"name":"icson","pid":35,"pricetype":2,"purchaseprice":900,"shipmentprice":99}],  
"product":  
{  
"type":121,  
"status":141  
}  
}  
}'

so, should i how to do it? Thanks very much.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3825e71c-0b3f-41f8-b944-0e2dded9ba7d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3825e71c-0b3f-41f8-b944-0e2dded9ba7d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [February 28, 2014, 12:59pm UTC](https://discuss.elastic.co/t/pls-how-to-use-doc-to-update-json-object-there-is-some-exception/16062/2 "2014-02-28T12:59:59Z")

</div>

Is it possible that you have a different Java version from your development  
machine and the ES server?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3df0aee-164f-4be4-871f-55c7d8b51825%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3df0aee-164f-4be4-871f-55c7d8b51825%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 1:46am UTC](https://discuss.elastic.co/t/pls-how-to-use-doc-to-update-json-object-there-is-some-exception/16062/3 "2017-07-06T01:46:35Z")

</div>


