# Retrieve length of array which is part of object present in map

**URL:** https://discuss.elastic.co/t/retrieve-length-of-array-which-is-part-of-object-present-in-map/364960
**Category:** Elasticsearch
**Created:** [August 15, 2024, 2:12pm UTC](https://discuss.elastic.co/t/retrieve-length-of-array-which-is-part-of-object-present-in-map/364960 "2024-08-15T14:12:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Abhi1984](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhi1984/32/122898_2.png) [@Abhi1984](https://discuss.elastic.co/u/Abhi1984)
#### Post date: [August 15, 2024, 2:12pm UTC](https://discuss.elastic.co/t/retrieve-length-of-array-which-is-part-of-object-present-in-map/364960/1 "2024-08-15T14:12:00Z")

</div>

Hi,

I'm need to write a query which provides the length of array fields inside an object which is stored as value in a map.

E.g.  
{  
"id":1,  
"data": {  
{  
"2023": {  
"array1" : ["A","B"],  
"array2" : ["A","B","C"]  
"array3" : ["Z","B"],  
"array4" : ["R","B"]  
},  
"2024": {  
"array1" : ["A","B"],  
"array2" : ["A","B","C"]  
"array3" : ["Z","B"],  
"array4" : ["R","B"]  
}  
}  
}  
}

So my requirement is to find the length of each array inside the map.

Thanks  
Abhi
