# Update \_meta using NEST

**URL:** <https://discuss.elastic.co/t/update-meta-using-nest/161207>\
**Category:** Elasticsearch\
**Created:** [December 17, 2018, 8:51pm UTC](https://discuss.elastic.co/t/update-meta-using-nest/161207 "2018-12-17T20:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cas4](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cas4](https://discuss.elastic.co/u/cas4)\
**Post date:** [December 17, 2018, 8:51pm UTC](https://discuss.elastic.co/t/update-meta-using-nest/161207/1 "2018-12-17T20:51:53Z")

</div>

I'm using the \_meta field to store information about my index. When I initialize the index, I'm able to add the meta-data using the following NEST syntax:

```
await Client.CreateIndexAsync(plugin.IndexName, (index) => index
    .Mappings(ms => ms
        .Map<IndexedObject>(m => m.AutoMap()
        .Meta(d => d.Add("foo", "bar"))
        )
    ));

```

The mapping is correctly saved as indicated by performing a GET /myindex/\_mapping:

```
"myindex": {
    "mappings": {
      "indexedobject": {
        "_meta": {
          "foo": "bar"
        }
...

```

Once the index is created and populated, I need a way to update the the \_meta tag. Using kibana, I can execute the following statement and the index is correctly updated:

```
POST /npairindex/_mapping/indexedobject
{
  "_meta": {
    "foo": "bar2"
  }
}

```

How do I perform the previous statement using NEST? Any help would be greatly appreciated.

---

<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:** [January 14, 2019, 8:51pm UTC](https://discuss.elastic.co/t/update-meta-using-nest/161207/2 "2019-01-14T20:51:55Z")

</div>

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