# Find nested document by min value of its field and apply another filters on this document

**URL:** <https://discuss.elastic.co/t/find-nested-document-by-min-value-of-its-field-and-apply-another-filters-on-this-document/306689>\
**Category:** Elasticsearch\
**Created:** [June 8, 2022, 11:31am UTC](https://discuss.elastic.co/t/find-nested-document-by-min-value-of-its-field-and-apply-another-filters-on-this-document/306689 "2022-06-08T11:31:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nat123](https://avatars.discourse-cdn.com/v4/letter/n/b2d939/32.png) [@Nat123](https://discuss.elastic.co/u/Nat123)\
**Post date:** [June 8, 2022, 11:31am UTC](https://discuss.elastic.co/t/find-nested-document-by-min-value-of-its-field-and-apply-another-filters-on-this-document/306689/1 "2022-06-08T11:31:27Z")

</div>

Hello,

I have a document (user) and a list of nested documents (orders) in Elastic. I need to find a user with an order satisfied a bunch of conditions: the status of order should have some specific value, its id should start with some specific digits and its date should be the min in the list of user's orders.

I didn't find a way how to do this. Is it possible?  
Please help ...

Thanks in advance!

---

<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, 2022, 11:31am UTC](https://discuss.elastic.co/t/find-nested-document-by-min-value-of-its-field-and-apply-another-filters-on-this-document/306689/2 "2022-07-06T11:31:40Z")

</div>

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