# Child field in has\_child query

**URL:** <https://discuss.elastic.co/t/child-field-in-has-child-query/38234>\
**Category:** Elasticsearch\
**Created:** [December 31, 2015, 7:50pm UTC](https://discuss.elastic.co/t/child-field-in-has-child-query/38234 "2015-12-31T19:50:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sundar\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sundar_v/32/6928_2.png) [@Sundar\_V](https://discuss.elastic.co/u/Sundar_V)\
**Post date:** [December 31, 2015, 7:50pm UTC](https://discuss.elastic.co/t/child-field-in-has-child-query/38234/1 "2015-12-31T19:50:59Z")

</div>

Hello

We have modeled based on parent-child relationship. Each child document has a field "date", that shows when the child was created. When we query the parent to get the list of parents, based on number of children, we also would like to get the first and the last dates of the child documents. Any tips on how this is possible?

---

<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 5, 2017, 11:27pm UTC](https://discuss.elastic.co/t/child-field-in-has-child-query/38234/2 "2017-07-05T23:27:33Z")

</div>


