# Updating nested date field format fails in 2.2.1

**URL:** <https://discuss.elastic.co/t/updating-nested-date-field-format-fails-in-2-2-1/45351>\
**Category:** Elasticsearch\
**Created:** [March 24, 2016, 1:42pm UTC](https://discuss.elastic.co/t/updating-nested-date-field-format-fails-in-2-2-1/45351 "2016-03-24T13:42:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peteradh](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@peteradh](https://discuss.elastic.co/u/peteradh)\
**Post date:** [March 24, 2016, 1:42pm UTC](https://discuss.elastic.co/t/updating-nested-date-field-format-fails-in-2-2-1/45351/1 "2016-03-24T13:42:31Z")

</div>

I currently run tests after migrating our dev system from ES 1.6.0 to 2.2.1. After migration, all 'date' fields still have "format": "dateOptionalTime" and I now need to update that to "format": "strict\_date\_optional\_time||epoch\_millis" to be able to index new data into existing indices using logstash.

I update the format as described here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html)

PUT my\_index/\_mapping/my\_type?update\_all\_types  
{  
"properties": {  
"my\_field": {  
"type": "date",  
"format": "strict\_date\_optional\_time||epoch\_millis"  
}  
}  
}

Using this for a 'normal' field is fine (although 'update\_all\_types' does not work and I have to update each field individually - but this appears to be issue #16239).

Now I want to update a nested field, which I normally would address as 'my\_field.my\_subfield'. But

PUT my\_index/\_mapping/my\_type?update\_all\_types  
{  
"properties": {  
"my\_field.my\_subfield": {  
"type": "date",  
"format": "strict\_date\_optional\_time||epoch\_millis"  
}  
}  
}

raises this:

{  
"error": {  
"root\_cause": [  
{  
"type": "mapper\_parsing\_exception",  
"reason": "Field name [my\_field.my\_subfield] cannot contain '.'"  
}  
],  
"type": "mapper\_parsing\_exception",  
"reason": "Field name [my\_field.my\_subfield] cannot contain '.'"  
},  
"status": 400  
}

I understand that from 2.0 onwards, field names may no longer contain a dot in their name - but this is no field with a dot in the name but a nested field. Any ideas how to update that other than by the dot notation?

---

<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 5, 2017, 11:05pm UTC](https://discuss.elastic.co/t/updating-nested-date-field-format-fails-in-2-2-1/45351/2 "2017-07-05T23:05:28Z")

</div>

Closed on July 5, 2017, 11:05pm UTC


