Alex Rivera | Logout

How can one shorten mongo ids for better use in URLs?

Asked 2010-11-23T21:26:37.223
14

I've built a number of python driven sites that utilize mongodb as a database backend and am very happy with it's ObjectId system, however, I'd love to be able encode the ids in a shorter fashion without building a mapping collection or utilizing a url-shortener service.

Suggestions? Success stories?

Edit
Report

1 Answer

0

If you can generate auto-incrementing unique numbers, there's absolutely no need to use ObjectId for _id. Doing this in a distributed environment will most likely be more expensive than using ObjectId. That's your tradeoff.

answered 2011-12-28T10:30:07.513

Your Answer