# How can i get exact the number of item in array?

**URL:** <https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520>\
**Category:** Kibana\
**Created:** [July 27, 2019, 11:26am UTC](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520 "2019-07-27T11:26:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyungsun\_lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyungsun_lim/32/50790_2.png) [@hyungsun\_lim](https://discuss.elastic.co/u/hyungsun_lim)\
**Post date:** [July 27, 2019, 11:26am UTC](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520/1 "2019-07-27T11:26:21Z")

</div>

How can i count exact the number of item in array object?

I have data like below.

doc1  
people :  
[  
{email:a@virtual.com},  
{email:b@virtual.com},  
{email:c@another.com}  
]

doc2  
people :  
[  
{email:d@virtual.com},  
{email:e@virtual.com},  
{email:f@another.com}  
]

I want to count the unique number of \*@another.com, in the documents.

So i did in kibana like below:

visualize -\>  
make data table -\>  
In metric 'Unique Count' and select 'people' metric -\>  
In bucket, select 'filter' aggregation -\>  
wrote people.email : "\*.another.com"

In result, it shows 6.  
But i want value 2 ([c@another.com](mailto:c@another.com) and [f@another.com](mailto:f@another.com))

In this case, how can i get exact the number of item in array.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [July 29, 2019, 6:34pm UTC](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520/2 "2019-07-29T18:34:31Z")

</div>

Kibana is not able to aggregate on nested types such as the arrays in your documents. [https://www.elastic.co/guide/en/kibana/current/nested-objects.html](https://www.elastic.co/guide/en/kibana/current/nested-objects.html)

We have an issue to track this feature request here. [https://github.com/elastic/kibana/issues/1084](https://github.com/elastic/kibana/issues/1084)

---

<div class="post-metadata">

**Author:** ![hyungsun\_lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyungsun_lim/32/50790_2.png) [@hyungsun\_lim](https://discuss.elastic.co/u/hyungsun_lim)\
**Post date:** [July 30, 2019, 5:08am UTC](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520/3 "2019-07-30T05:08:37Z")

</div>

Thank you 🙂

---

<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:** [August 27, 2019, 5:08am UTC](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520/4 "2019-08-27T05:08:38Z")

</div>

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