# Error in updating an existing document field count in Elasticsearch

**URL:** <https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211>\
**Category:** Elasticsearch\
**Created:** [January 2, 2013, 7:03am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211 "2013-01-02T07:03:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Moo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathan_moo/32/2562_2.png) [@Jonathan\_Moo](https://discuss.elastic.co/u/Jonathan_Moo)\
**Post date:** [January 2, 2013, 7:03am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/1 "2013-01-02T07:03:42Z")

</div>

I have indexed a document in Elasticsearch as follows:

{  
\_parent: chow-demo  
\_index: prototype\_2013.01.02  
\_type: chow-clfg  
\_id: Nx4JcvyxTPujkyy0Jq5BNw  
\_score: 11.600378  
\_source: {  
chow-clfg: {  
@type: chow-clfg  
clfg: Cg5iV00z4woYAAAARQ0  
@timestamp: 2013-01-02T06:26:00.000Z  
count: 1  
}  
}  
}

I tried to update the count field by the following command:

curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'

However I received the following error instead:

{"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}

What exactly have I done that is missing? I was following the documents at  
[http://www.elasticsearch.org/guide/reference/api/update.html](http://www.elasticsearch.org/guide/reference/api/update.html) and yet it  
doesn't work.

Also, I included the parent field:

curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'

And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 2, 2013, 1:03pm UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/2 "2013-01-02T13:03:24Z")

</div>

You should specify parent on URI (not in the body of the request).

On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:

> I have indexed a document in Elasticsearch as follows:
> 
> {  
> \_parent: chow-demo  
> \_index: prototype\_2013.01.02  
> \_type: chow-clfg  
> \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> \_score: 11.600378  
> \_source: {  
> chow-clfg: {  
> @type: chow-clfg  
> clfg: Cg5iV00z4woYAAAARQ0  
> @timestamp: 2013-01-02T06:26:00.000Z  
> count: 1  
> }  
> }  
> }
> 
> I tried to update the count field by the following command:
> 
> curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> 
> However I received the following error instead:
> 
> {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> 
> What exactly have I done that is missing? I was following the documents at  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and yet it  
> doesn't work.
> 
> Also, I included the parent field:
> 
> curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> 
> And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Jonathan\_Moo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathan_moo/32/2562_2.png) [@Jonathan\_Moo](https://discuss.elastic.co/u/Jonathan_Moo)\
**Post date:** [January 3, 2013, 2:25am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/3 "2013-01-03T02:25:03Z")

</div>

Hi Igor,

I specified the request as followed:

curl -XPOST  
'localhost:9200/prototype\_2013.01.03/chow-clfg/YCKJVCgzQM2z8V663Zu0Ag/\_update?parent=chow-demo'  
-d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'

and I still received the DocumentMissingException though, even when I could  
search for the exact document.

Jonathan

On Wednesday, 2 January 2013 21:03:24 UTC+8, Igor Motov wrote:

> You should specify parent on URI (not in the body of the request).
> 
> On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:
> 
> > I have indexed a document in Elasticsearch as follows:
> > 
> > {  
> > \_parent: chow-demo  
> > \_index: prototype\_2013.01.02  
> > \_type: chow-clfg  
> > \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> > \_score: 11.600378  
> > \_source: {  
> > chow-clfg: {  
> > @type: chow-clfg  
> > clfg: Cg5iV00z4woYAAAARQ0  
> > @timestamp: 2013-01-02T06:26:00.000Z  
> > count: 1  
> > }  
> > }  
> > }
> > 
> > I tried to update the count field by the following command:
> > 
> > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > 
> > However I received the following error instead:
> > 
> > {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> > 
> > What exactly have I done that is missing? I was following the documents  
> > at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and yet  
> > it doesn't work.
> > 
> > Also, I included the parent field:
> > 
> > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > 
> > And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 3, 2013, 2:53am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/4 "2013-01-03T02:53:04Z")

</div>

Can you provide a full repro? It seems to work for me:  
[chow-demo.sh · GitHub](https://gist.github.com/b01e8706948d2bd2c943)

On Wednesday, January 2, 2013 9:25:03 PM UTC-5, Jonathan Moo wrote:

> Hi Igor,
> 
> I specified the request as followed:
> 
> curl -XPOST  
> 'localhost:9200/prototype\_2013.01.03/chow-clfg/YCKJVCgzQM2z8V663Zu0Ag/\_update?parent=chow-demo'  
> -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> 
> and I still received the DocumentMissingException though, even when I  
> could search for the exact document.
> 
> Jonathan
> 
> On Wednesday, 2 January 2013 21:03:24 UTC+8, Igor Motov wrote:
> 
> > You should specify parent on URI (not in the body of the request).
> > 
> > On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:
> > 
> > > I have indexed a document in Elasticsearch as follows:
> > > 
> > > {  
> > > \_parent: chow-demo  
> > > \_index: prototype\_2013.01.02  
> > > \_type: chow-clfg  
> > > \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> > > \_score: 11.600378  
> > > \_source: {  
> > > chow-clfg: {  
> > > @type: chow-clfg  
> > > clfg: Cg5iV00z4woYAAAARQ0  
> > > @timestamp: 2013-01-02T06:26:00.000Z  
> > > count: 1  
> > > }  
> > > }  
> > > }
> > > 
> > > I tried to update the count field by the following command:
> > > 
> > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > 
> > > However I received the following error instead:
> > > 
> > > {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> > > 
> > > What exactly have I done that is missing? I was following the documents  
> > > at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and yet  
> > > it doesn't work.
> > > 
> > > Also, I included the parent field:
> > > 
> > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > 
> > > And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Jonathan\_Moo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathan_moo/32/2562_2.png) [@Jonathan\_Moo](https://discuss.elastic.co/u/Jonathan_Moo)\
**Post date:** [January 3, 2013, 4:11am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/5 "2013-01-03T04:11:38Z")

</div>

Thanks Imotov, you are right; it works when I follow your example.  
Initially it couldn't work because I thought I could do \*  
ctx.\_source.chow-clfg.count+=num\* instead of \*  
ctx.\_source["chow-clfg"].count+=num\*.

I just realized it still doesn't work for me when I am using Nodejs to run  
and somehow the JSON parser can't seem to parse the backslashes properly.  
Any advice on this?

> <https://gist.github.com/webmusing/7f0e6c996d9c4cc512ec>

Regards,  
Jonathan

On Thursday, 3 January 2013 10:53:04 UTC+8, Igor Motov wrote:

> Can you provide a full repro? It seems to work for me:  
> [chow-demo.sh · GitHub](https://gist.github.com/b01e8706948d2bd2c943)
> 
> On Wednesday, January 2, 2013 9:25:03 PM UTC-5, Jonathan Moo wrote:
> 
> > Hi Igor,
> > 
> > I specified the request as followed:
> > 
> > curl -XPOST  
> > 'localhost:9200/prototype\_2013.01.03/chow-clfg/YCKJVCgzQM2z8V663Zu0Ag/\_update?parent=chow-demo'  
> > -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > 
> > and I still received the DocumentMissingException though, even when I  
> > could search for the exact document.
> > 
> > Jonathan
> > 
> > On Wednesday, 2 January 2013 21:03:24 UTC+8, Igor Motov wrote:
> > 
> > > You should specify parent on URI (not in the body of the request).
> > > 
> > > On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:
> > > 
> > > > I have indexed a document in Elasticsearch as follows:
> > > > 
> > > > {  
> > > > \_parent: chow-demo  
> > > > \_index: prototype\_2013.01.02  
> > > > \_type: chow-clfg  
> > > > \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> > > > \_score: 11.600378  
> > > > \_source: {  
> > > > chow-clfg: {  
> > > > @type: chow-clfg  
> > > > clfg: Cg5iV00z4woYAAAARQ0  
> > > > @timestamp: 2013-01-02T06:26:00.000Z  
> > > > count: 1  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > I tried to update the count field by the following command:
> > > > 
> > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > 
> > > > However I received the following error instead:
> > > > 
> > > > {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> > > > 
> > > > What exactly have I done that is missing? I was following the documents  
> > > > at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and  
> > > > yet it doesn't work.
> > > > 
> > > > Also, I included the parent field:
> > > > 
> > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > 
> > > > And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 3, 2013, 4:15am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/6 "2013-01-03T04:15:42Z")

</div>

I would try something like var script =  
'ctx.\_source[\"chow-clfg\"].count+=num';

On Wednesday, January 2, 2013 11:11:38 PM UTC-5, Jonathan Moo wrote:

> Thanks Imotov, you are right; it works when I follow your example.  
> Initially it couldn't work because I thought I could do \*  
> ctx.\_source.chow-clfg.count+=num\* instead of \*  
> ctx.\_source["chow-clfg"].count+=num\*.
> 
> I just realized it still doesn't work for me when I am using Nodejs to run  
> and somehow the JSON parser can't seem to parse the backslashes properly.  
> Any advice on this?  
> [Error in updating an existing document field count in Elasticsearch · GitHub](https://gist.github.com/7f0e6c996d9c4cc512ec)
> 
> Regards,  
> Jonathan
> 
> On Thursday, 3 January 2013 10:53:04 UTC+8, Igor Motov wrote:
> 
> > Can you provide a full repro? It seems to work for me:  
> > [chow-demo.sh · GitHub](https://gist.github.com/b01e8706948d2bd2c943)
> > 
> > On Wednesday, January 2, 2013 9:25:03 PM UTC-5, Jonathan Moo wrote:
> > 
> > > Hi Igor,
> > > 
> > > I specified the request as followed:
> > > 
> > > curl -XPOST  
> > > 'localhost:9200/prototype\_2013.01.03/chow-clfg/YCKJVCgzQM2z8V663Zu0Ag/\_update?parent=chow-demo'  
> > > -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > 
> > > and I still received the DocumentMissingException though, even when I  
> > > could search for the exact document.
> > > 
> > > Jonathan
> > > 
> > > On Wednesday, 2 January 2013 21:03:24 UTC+8, Igor Motov wrote:
> > > 
> > > > You should specify parent on URI (not in the body of the request).
> > > > 
> > > > On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:
> > > > 
> > > > > I have indexed a document in Elasticsearch as follows:
> > > > > 
> > > > > {  
> > > > > \_parent: chow-demo  
> > > > > \_index: prototype\_2013.01.02  
> > > > > \_type: chow-clfg  
> > > > > \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> > > > > \_score: 11.600378  
> > > > > \_source: {  
> > > > > chow-clfg: {  
> > > > > @type: chow-clfg  
> > > > > clfg: Cg5iV00z4woYAAAARQ0  
> > > > > @timestamp: 2013-01-02T06:26:00.000Z  
> > > > > count: 1  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > I tried to update the count field by the following command:
> > > > > 
> > > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > > 
> > > > > However I received the following error instead:
> > > > > 
> > > > > {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> > > > > 
> > > > > What exactly have I done that is missing? I was following the  
> > > > > documents at  
> > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and yet  
> > > > > it doesn't work.
> > > > > 
> > > > > Also, I included the parent field:
> > > > > 
> > > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > > 
> > > > > And it still didn't work. Anyone can help me with this error?

--

---

<div class="post-metadata">

**Author:** ![Jonathan\_Moo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathan_moo/32/2562_2.png) [@Jonathan\_Moo](https://discuss.elastic.co/u/Jonathan_Moo)\
**Post date:** [January 3, 2013, 6:17am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/7 "2013-01-03T06:17:45Z")

</div>

Hi Igor,

I tried your suggestion, but it didn't work.

However, I tried something like this:

var script = "ctx.\_source["chow-clfg"].count+=num";  
script = JSON.stringify(script);  
var data = '{"script":'+script+',"params":{"num":1}}';  
data = JSON.stringify(data);  
data = JSON.parse(data);

And finally it works.

Really thanks for all your help!

Jonathan

On Thursday, 3 January 2013 12:15:42 UTC+8, Igor Motov wrote:

> I would try something like var script =  
> 'ctx.\_source[\"chow-clfg\"].count+=num';
> 
> On Wednesday, January 2, 2013 11:11:38 PM UTC-5, Jonathan Moo wrote:
> 
> > Thanks Imotov, you are right; it works when I follow your example.  
> > Initially it couldn't work because I thought I could do \*  
> > ctx.\_source.chow-clfg.count+=num\* instead of \*  
> > ctx.\_source["chow-clfg"].count+=num\*.
> > 
> > I just realized it still doesn't work for me when I am using Nodejs to  
> > run and somehow the JSON parser can't seem to parse the backslashes  
> > properly. Any advice on this?  
> > [Error in updating an existing document field count in Elasticsearch · GitHub](https://gist.github.com/7f0e6c996d9c4cc512ec)
> > 
> > Regards,  
> > Jonathan
> > 
> > On Thursday, 3 January 2013 10:53:04 UTC+8, Igor Motov wrote:
> > 
> > > Can you provide a full repro? It seems to work for me:  
> > > [chow-demo.sh · GitHub](https://gist.github.com/b01e8706948d2bd2c943)
> > > 
> > > On Wednesday, January 2, 2013 9:25:03 PM UTC-5, Jonathan Moo wrote:
> > > 
> > > > Hi Igor,
> > > > 
> > > > I specified the request as followed:
> > > > 
> > > > curl -XPOST  
> > > > 'localhost:9200/prototype\_2013.01.03/chow-clfg/YCKJVCgzQM2z8V663Zu0Ag/\_update?parent=chow-demo'  
> > > > -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > 
> > > > and I still received the DocumentMissingException though, even when I  
> > > > could search for the exact document.
> > > > 
> > > > Jonathan
> > > > 
> > > > On Wednesday, 2 January 2013 21:03:24 UTC+8, Igor Motov wrote:
> > > > 
> > > > > You should specify parent on URI (not in the body of the request).
> > > > > 
> > > > > On Wednesday, January 2, 2013 2:03:42 AM UTC-5, Jonathan Moo wrote:
> > > > > 
> > > > > > I have indexed a document in Elasticsearch as follows:
> > > > > > 
> > > > > > {  
> > > > > > \_parent: chow-demo  
> > > > > > \_index: prototype\_2013.01.02  
> > > > > > \_type: chow-clfg  
> > > > > > \_id: Nx4JcvyxTPujkyy0Jq5BNw  
> > > > > > \_score: 11.600378  
> > > > > > \_source: {  
> > > > > > chow-clfg: {  
> > > > > > @type: chow-clfg  
> > > > > > clfg: Cg5iV00z4woYAAAARQ0  
> > > > > > @timestamp: 2013-01-02T06:26:00.000Z  
> > > > > > count: 1  
> > > > > > }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > I tried to update the count field by the following command:
> > > > > > 
> > > > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > > > 
> > > > > > However I received the following error instead:
> > > > > > 
> > > > > > {"error":"RemoteTransportException[[Vesta][inet[/10.15.78.249:9300]][update]]; nested: DocumentMissingException[[prototype\_2013.01.02][0] [chow-clfg][Nx4JcvyxTPujkyy0Jq5BNw]: document missing]; ","status":404}
> > > > > > 
> > > > > > What exactly have I done that is missing? I was following the  
> > > > > > documents at  
> > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) and yet  
> > > > > > it doesn't work.
> > > > > > 
> > > > > > Also, I included the parent field:
> > > > > > 
> > > > > > curl -XPOST 'localhost:9200/prototype\_2013.01.02/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/\_update' -d '{"parent":"chow-demo","script":"ctx.\_source.chow-clfg.count+=num","params":{"num":1}}'
> > > > > > 
> > > > > > And it still didn't work. Anyone can help me with this error?

--

---

<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, 2:57am UTC](https://discuss.elastic.co/t/error-in-updating-an-existing-document-field-count-in-elasticsearch/10211/8 "2017-07-06T02:57:57Z")

</div>


