Updating nested hash

Hi,

I have been trying to _update a nested hash and am facing some issues. My doc looks like this
curl -XGET http://localhost:9200/twitter/tweet/QTEYNIn6Tdej0rQNW4Nh-A?pretty=true
{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "QTEYNIn6Tdej0rQNW4Nh-A",
"_version" : 7,
"exists" : true, "_source" : {"last_seen":"20130726T15:32:39","hit_count":1,"hits_by_day":{"20130726":1},"remote_addr":["10.10.10.10"]}}

Here I am trying to add 1 to "20130726", however accessing the variable and setting it seems to be the issue. When I run the below query I get no error, the query executes and the _version changes. However there are no changes to the field.

The issue might be the way I am trying to access the hash.

curl -XPOST http://localhost:9200/twitter/tweet/QTEYNIn6Tdej0rQNW4Nh-A' -d '
{
"script":"ctx._source.hits_by_day.containsKey("todate") ? ctx._source.hits_by_day.todate += count : ctx._source.hits_by_day.todate = 1;",
"params":{
"count":1,"todate":"20130726"}}'

{"ok":true,"_index":"twitter","_type":"tweet","_id":"QTEYNIn6Tdej0rQNW4Nh-A","_version":7}

Thanks a ton for the help.

Harsh