# What is the mapping for array of arrays

**URL:** <https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039>\
**Category:** Elasticsearch\
**Created:** [October 26, 2016, 5:29pm UTC](https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039 "2016-10-26T17:29:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pungent](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@pungent](https://discuss.elastic.co/u/pungent)\
**Post date:** [October 26, 2016, 5:29pm UTC](https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039/1 "2016-10-26T17:29:15Z")

</div>

I am planning to store data for a field in this way:

```
"pair_age": [
   [12, 19], [17,20], [34,35]
 ]

```

So in mapping how to set it:

```
"pair_age": { "type": "????" }

```

What should I set the value of `????` above?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 26, 2016, 8:24pm UTC](https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039/2 "2016-10-26T20:24:57Z")

</div>

Hi,

you cannot really store arrays of arrays directly and then query for a specific pair, due to the way this data is stored internally in Lucene. The documentation about [Array datatype](https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html) and [Nested datatype](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) explain this in more detail and also provide an alternative, depending on how you need to access your data later.

---

<div class="post-metadata">

**Author:** ![pungent](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@pungent](https://discuss.elastic.co/u/pungent)\
**Post date:** [October 27, 2016, 3:36am UTC](https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039/3 "2016-10-27T03:36:11Z")

</div>

Thank you got it

---

<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, 10:09pm UTC](https://discuss.elastic.co/t/what-is-the-mapping-for-array-of-arrays/64039/4 "2017-07-05T22:09:13Z")

</div>


