By default, _id fields for MongoDB documents always contain 24 hexadecimal characters?

As part of my application requirements, I have a 30 character limit for the ID field. This is out of my control and I am wondering if MongoDB's default _id fields will work for me. It seems that the _id field is 24 characters by default. This works for me, but I wonder if this will change in the future. I know well that things can always change, but over the next year or two I can expect that there will be 24 character fields by default _id?

+5
source share
1 answer

Actually they are not 24 characters - they are 12 bytes (24 characters in hexadecimal notation). And yes, this will take place in the foreseeable future.

+12
source

All Articles