# Cannot add a value for field \[stepContexts.pageContext.metas\] since one of the intermediate objects is mapped as a nested object: \[stepContexts\]

**URL:** <https://discuss.elastic.co/t/cannot-add-a-value-for-field-stepcontexts-pagecontext-metas-since-one-of-the-intermediate-objects-is-mapped-as-a-nested-object-stepcontexts/308122>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [June 24, 2022, 2:09pm UTC](https://discuss.elastic.co/t/cannot-add-a-value-for-field-stepcontexts-pagecontext-metas-since-one-of-the-intermediate-objects-is-mapped-as-a-nested-object-stepcontexts/308122 "2022-06-24T14:09:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sohaib\_Ameen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sohaib_ameen/32/106389_2.png) [@Sohaib\_Ameen](https://discuss.elastic.co/u/Sohaib_Ameen)\
**Post date:** [June 24, 2022, 2:09pm UTC](https://discuss.elastic.co/t/cannot-add-a-value-for-field-stepcontexts-pagecontext-metas-since-one-of-the-intermediate-objects-is-mapped-as-a-nested-object-stepcontexts/308122/1 "2022-06-24T14:09:07Z")

</div>

```
     "stepContexts" : {
        "type" : "nested",
        "properties" : {
          "additionalContext" : {
            "type" : "text",
            "analyzer" : "custom_analyzer"
          },
          "branchId" : {
            "type" : "float"
          },
          "caption" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "pageContext" : {
            "type" : "nested",
            "properties" : {
              "cookies" : {
                "type" : "text",
                "analyzer" : "custom_analyzer"
              },
              "links" : {
                "type" : "nested",
                "properties" : {
                  "Links" : {
                    "type" : "text",
                    "analyzer" : "standard"
                  }
                }
              },
              "localStorageData" : {
                "type" : "nested",
                "properties" : {
                  "data" : {
                    "type" : "text",
                    "analyzer" : "keyword"
                  },
                  "key" : {
                    "type" : "text",
                    "analyzer" : "standard"
                  }
                }
              },
              "pageSize" : {
                "type" : "float"
              },
              "scripts" : {
                "type" : "nested",
                "properties" : {
                  "Scripts" : {
                    "type" : "text",
                    "analyzer" : "standard"
                  }
                }
              },
              "title" : {
                "type" : "text",
                "analyzer" : "standard"
              },
              "treeCount" : {
                "type" : "float"
              },
              "url" : {
                "type" : "text",
                "analyzer" : "keyword"
              },
              "version" : {
                "type" : "text",
                "analyzer" : "standard"
              }
            }
          },
          "processName" : {
            "type" : "text",
            "analyzer" : "custom_analyzer"
          },
          "stepId" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "stepNumber" : {
            "type" : "float"
          },
          "url" : {
            "type" : "text",
            "analyzer" : "keyword"
          }
        }
      },

```

I am trying to data in the form of string array for "links", "metas", "scripts" properties using NEST 6.0.0.0 library in .NET core with Elasticsearch version of 6.8 with the method "IndexAsync" but I keep getting this error. It seems to have a problem with mapping so I deleted the index and recreated it but It thrown the exception. Please suggest how to fix it if there is any solution for it. I inserted the data from kibana query and it works fine but with NEST its not working.

Thanks

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [June 29, 2022, 4:13pm UTC](https://discuss.elastic.co/t/cannot-add-a-value-for-field-stepcontexts-pagecontext-metas-since-one-of-the-intermediate-objects-is-mapped-as-a-nested-object-stepcontexts/308122/2 "2022-06-29T16:13:31Z")

</div>

What is your action? Update documents or create?  
I'm not familiar with NET but the error messages seems against updates.

What you did on kibana and NEST was completely the same?

---

<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 27, 2022, 4:13pm UTC](https://discuss.elastic.co/t/cannot-add-a-value-for-field-stepcontexts-pagecontext-metas-since-one-of-the-intermediate-objects-is-mapped-as-a-nested-object-stepcontexts/308122/3 "2022-07-27T16:13:38Z")

</div>

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