# Max Id Size

**URL:** <https://discuss.elastic.co/t/max-id-size/5733>\
**Category:** Elasticsearch\
**Created:** [November 1, 2011, 4:19am UTC](https://discuss.elastic.co/t/max-id-size/5733 "2011-11-01T04:19:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knighting\_Ace](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/knighting_ace/32/3091_2.png) [@Knighting\_Ace](https://discuss.elastic.co/u/Knighting_Ace)\
**Post date:** [November 1, 2011, 4:19am UTC](https://discuss.elastic.co/t/max-id-size/5733/1 "2011-11-01T04:19:52Z")

</div>

I'm basically doing my own bridge between mongodb and elasticsearch.  
What I want to do is use the mongodb id as the id for elasticsearch.  
Mongodb, however, uses ids that are 12 bytes long so I was wondering  
if elasticsearch index would fit this or would I have to add a another  
field within the index. I tried searching around for the information  
but found nothing so far.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 1, 2011, 5:49pm UTC](https://discuss.elastic.co/t/max-id-size/5733/2 "2011-11-01T17:49:00Z")

</div>

You can use the string representation of the mongodb id, there is no limit  
on the size of the id in elasticsearch.

On Tue, Nov 1, 2011 at 6:19 AM, Knighting Ace [knaces@gmail.com](mailto:knaces@gmail.com) wrote:

> I'm basically doing my own bridge between mongodb and elasticsearch.  
> What I want to do is use the mongodb id as the id for elasticsearch.  
> Mongodb, however, uses ids that are 12 bytes long so I was wondering  
> if elasticsearch index would fit this or would I have to add a another  
> field within the index. I tried searching around for the information  
> but found nothing so far.

---

<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, 2017, 3:50am UTC](https://discuss.elastic.co/t/max-id-size/5733/3 "2017-07-06T03:50:13Z")

</div>

Closed on July 6, 2017, 3:50am UTC


