# Push/pop element to array (PATCH request)

**URL:** https://discuss.elastic.co/t/push-pop-element-to-array-patch-request/266136
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [March 3, 2021, 3:28pm UTC](https://discuss.elastic.co/t/push-pop-element-to-array-patch-request/266136 "2021-03-03T15:28:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lautaro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lautaro/32/84552_2.png) [@Lautaro](https://discuss.elastic.co/u/Lautaro)
#### Post date: [March 3, 2021, 3:28pm UTC](https://discuss.elastic.co/t/push-pop-element-to-array-patch-request/266136/1 "2021-03-03T15:28:44Z")

</div>

How can I add or delete elements from an array without having to query the document to update them programmatically (modifying the queried document to update the array with a back-end language)?

The documentation does not show how to update arrays inside the box.  
[[Documents API | Elastic App Search Documentation [8.4] | Elastic](https://www.elastic.co/guide/en/app-search/current/documents.html#documents-partial)]([https://Update](https://Update) Documents)

---

<div class="post-metadata">

### Author: ![constancecchen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/constancecchen/32/71762_2.png) [@constancecchen](https://discuss.elastic.co/u/constancecchen)
#### Post date: [March 4, 2021, 12:00am UTC](https://discuss.elastic.co/t/push-pop-element-to-array-patch-request/266136/2 "2021-03-04T00:00:15Z")

</div>

Hey Lautaro! You're correct that we don't have any APIs specifically for pushing onto existing arrays. You do need to first GET the document/field that you want to update & modify it manually or on your own server before updating/PATCHing the document.

Apologies I couldn't be more helpful - I can definitely bring this feedback to the team if there's more demand for tools and helpers for working with more complex types!

---

<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: [April 1, 2021, 12:00am UTC](https://discuss.elastic.co/t/push-pop-element-to-array-patch-request/266136/3 "2021-04-01T00:00:40Z")

</div>

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