# Update field in nested object

**URL:** <https://discuss.elastic.co/t/update-field-in-nested-object/81216>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 8:11pm UTC](https://discuss.elastic.co/t/update-field-in-nested-object/81216 "2017-04-04T20:11:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemarsha](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lemarsha](https://discuss.elastic.co/u/lemarsha)\
**Post date:** [April 4, 2017, 8:11pm UTC](https://discuss.elastic.co/t/update-field-in-nested-object/81216/1 "2017-04-04T20:11:30Z")

</div>

Hi,

I have a nested field of objects. I have a use case where I want to edit a field within a specific nested object.

```
{
    "mappings" : {
         "item" {
             "id" : {"type" : "keyword"},
             "vendors" : {
                 "type" : "nested",
                 "properties" : {
                     "vendor_name" : {"type" : "keyword"}
                     "sku" : {"type" : "keyword"}
                     "inventory" : {"type" : "integer"}
                     "bound" : {"type" : "integer"}
                 }
             }
         }
    }
}

```

I need to update properties like inventory based on a notification that someone has ordered something, so bound quantity would increment by 1. Is there a way to access a particular nested object? For example, access based on the vendor code? I've seen that I can do this by looping over the nested attributes and checking to see if one has the matching vendor code, but I am wondering if I can directly access.

Hopefully this isn't a repeat question. I've been searching blog posts and documentation and haven't found a solution for this, but it is possible I have missed something, or it is not supported.

Thanks so much!  
Colin

---

<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:** [May 2, 2017, 8:11pm UTC](https://discuss.elastic.co/t/update-field-in-nested-object/81216/2 "2017-05-02T20:11:42Z")

</div>

Closed on May 2, 2017, 8:11pm UTC

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