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

**URL:** <https://discuss.elastic.co/t/how-can-i-count-exact-the-number-of-item-in-array-object/192153>\
**Category:** Kibana\
**Created:** [July 25, 2019, 2:30am UTC](https://discuss.elastic.co/t/how-can-i-count-exact-the-number-of-item-in-array-object/192153 "2019-07-25T02:30:13Z")\
**Posts on this page:** 3\
**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 25, 2019, 2:30am UTC](https://discuss.elastic.co/t/how-can-i-count-exact-the-number-of-item-in-array-object/192153/1 "2019-07-25T02:30:13Z")

</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, 8:36pm UTC](https://discuss.elastic.co/t/how-can-i-count-exact-the-number-of-item-in-array-object/192153/2 "2019-07-29T20:36:49Z")

</div>

Please see my answer in your other post. [How can i get exact the number of item in array?](https://discuss.elastic.co/t/how-can-i-get-exact-the-number-of-item-in-array/192520)

---

<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 26, 2019, 8:46pm UTC](https://discuss.elastic.co/t/how-can-i-count-exact-the-number-of-item-in-array-object/192153/3 "2019-08-26T20:46:03Z")

</div>

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