Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're basically implementing an optimized version of ObjectId for your use case and having to take a couple stabs at it as well. No big deal, but there are just lots of little tricks like that to learn with MongoDB.

"My stuff wouldn't work on PostgreSQL at all, I have so much data that I must use sharding."

We had to implement sharding as well and chose to do it manually in PostgreSQL. Luckily our schema made that relatively easy and natural. YMMV



As mathias_10gen points out below this is the default behavior of ObjectId. You just have to be carful if you decide to override the _id field.


It isn't just the _id field, it's any indexed field.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: