ruby on rails - For devs who are using mongodb to build their web apps, what do you do about the long primary keys? -


IDs of RDBMS are usually simple integers, ranging from 0 to whatever number, but usually you can place them in 5 digits. Range so that you can create URLs that look like this

myawesomeblog.com/posts/23456

But with this unique identifier mongodb for each record in this way. 47cc67093475061e3d95369d

And depending on this, the building and app will take you to this URL such as myawesomeblog.com/posts/47cc67093475061e3d95369d

I do not like it? Does Mango give you an integer based ID number to make it anyway, which is small and unique? (Like MySQL)

Here is a link to make an incremental value from DOCS

  http://www.mongodb.org/display/DOCS/Atomic+Operations#AtomicOperations-%22InsertifNotPresent%22  

Comments