# Elasticsearch : Return the value of a field in the latest document created each day for the last one month

**URL:** <https://discuss.elastic.co/t/elasticsearch-return-the-value-of-a-field-in-the-latest-document-created-each-day-for-the-last-one-month/267327>\
**Category:** Elasticsearch\
**Created:** [March 16, 2021, 7:51am UTC](https://discuss.elastic.co/t/elasticsearch-return-the-value-of-a-field-in-the-latest-document-created-each-day-for-the-last-one-month/267327 "2021-03-16T07:51:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bengagi\_Foued](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bengagi_foued/32/61961_2.png) [@Bengagi\_Foued](https://discuss.elastic.co/u/Bengagi_Foued)\
**Post date:** [March 16, 2021, 7:51am UTC](https://discuss.elastic.co/t/elasticsearch-return-the-value-of-a-field-in-the-latest-document-created-each-day-for-the-last-one-month/267327/1 "2021-03-16T07:51:10Z")

</div>

I have a collection with documents updating everyday. Can someone provide me some suggestion for returning the value of a field in the latest document for each day for the last one month my document is like the one bellow :

```
{ "_index": "myIndex", "_type": "myIndex", "_id": "sh0i73EBGnoH6tYs24jh", "_score": 1, "_source": {
"date": "2020-01-24T23:29:58+01:00", "myField": "4" } }
```

---

<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 13, 2021, 7:51am UTC](https://discuss.elastic.co/t/elasticsearch-return-the-value-of-a-field-in-the-latest-document-created-each-day-for-the-last-one-month/267327/2 "2021-04-13T07:51:54Z")

</div>

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