# Array push

**URL:** <https://discuss.elastic.co/t/array-push/4713>\
**Category:** Elasticsearch\
**Created:** [June 27, 2011, 10:26am UTC](https://discuss.elastic.co/t/array-push/4713 "2011-06-27T10:26:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Spalding](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jon_spalding/32/2089_2.png) [@Jon\_Spalding](https://discuss.elastic.co/u/Jon_Spalding)\
**Post date:** [June 27, 2011, 10:26am UTC](https://discuss.elastic.co/t/array-push/4713/1 "2011-06-27T10:26:03Z")

</div>

Hi,

Is there a way in ES to push values to an array field in a document in  
one operation (i.e without reading the document to get the existing  
values)?

In my test if you pass an array in a PUT it overrides the existing  
values.

Many thanks,  
Jon

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 27, 2011, 10:36am UTC](https://discuss.elastic.co/t/array-push/4713/2 "2011-06-27T10:36:24Z")

</div>

Hi Jon

> Is there a way in ES to push values to an array field in a document in  
> one operation (i.e without reading the document to get the existing  
> values)?
> 
> In my test if you pass an array in a PUT it overrides the existing  
> values.

No there isn't

clint

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 27, 2011, 1:28pm UTC](https://discuss.elastic.co/t/array-push/4713/3 "2011-06-27T13:28:18Z")

</div>

you need to get the document before + update. Have a look into the new  
realtime GET operation:

> <https://github.com/elastic/elasticsearch/issues/1060>
>
> Realtime GET support allows to get a document once indexed regardless of the "re…fresh rate" of the index. It is enabled by default.
> 
> In order to disable realtime GET, one can either set \`realtime\` parameter to \`false\`, or globally default it to by setting the \`action.get.realtime\` to \`false\` in the node configuration.
> \# Realtime GET and stored fields
> 
> When getting a document, one can specify \`fields\` to fetch from it. They will, when possible, be fetched as stored fields (fields mapped as stored in the mapping). When using realtime GET, there is no notion of stored fields (at least for a period of time, basically, until the next flush), so they will be extracted from the source itself (note, even if source is not enabled). It is a good practice to assume that the fields will be loaded from source when using realtime GET, even if the fields are stored.

On Jun 27, 12:26 pm, Jon Spalding [jon.spald...@gmail.com](mailto:jon.spald...@gmail.com) wrote:

> Hi,
> 
> Is there a way in ES to push values to an array field in a document in  
> one operation (i.e without reading the document to get the existing  
> values)?
> 
> In my test if you pass an array in a PUT it overrides the existing  
> values.
> 
> Many thanks,  
> Jon

---

<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 6, 2017, 4:02am UTC](https://discuss.elastic.co/t/array-push/4713/4 "2017-07-06T04:02:31Z")

</div>


