I build a site with referral links to products and working with mongodb. We all know that the long _id field looks ugly in Urls e.g. http://website.com/p/532600d9a715ea980a00002b/u/532af835a715eae43f00002c.
I have read some posts here and googled a while and wondered why people don't generate this easy unique id:
- Count current documents in collection
- add 1 to the number
- append a field to document called e.g. 'unique'
So each document got a unique number starting with 1 and urls would look like this then http://website.com/p/1/u/2.
I won't delete any document.
Where is the problem with this solution?