title: Updating document in Elastic App Search with script not working
body: <p>I am fairly new to the elastic search, and I am using the <strong>Elastic App Search</strong>.</p>
  <p>So I am trying to update data in elastic app-search through MongoDB Realm App which basically provide triggers on CRUD operations.</p>
  <p>I am able to add documents or update existing fields.</p>
  <p>But the problem is I am unable to add elements to the array field. I want to add or delete elements from array, after some research I found out that it can be done using some scripts:</p>
  <pre><code>&quot;script&quot;: {
    &quot;source&quot;: &quot;ctx._source.fieldToUpdate.add(elementToAdd);&quot;,
    &quot;lang&quot;: &quot;painless&quot;
  }
  </code></pre>
  <p>But it's just not working. I am using <strong>REST APIs</strong> to add or update data in elastic app search. And I am using elastic cloud managed service.</p>
  <p><strong>UPDATE - 1</strong></p>
  <p>I was using ES App Search, and I created and named the engine as &quot;articles&quot;, when I tried to run queries using kibana, I had to use some weird name &quot;.ent-search-engine-documents-article&quot;.
  So I tried using the same name in Elastic Search REST API</p>
  <blockquote>
  <p>POST /.ent-search-engine-documents-article/_update/docid</p>
  </blockquote>
  <p>And it worked perfectly fine, but I want to perform the same work using REST API of APP Search only.</p>