Abhishek
Abhishek11mo ago

document id as pathname

So I'm using the document ID as a pathname, which is making url ugly and too long is there any alternate approach that I can use? So it's like for example -> abc/[document_id] and when someone goes to abc/[document_id] through the document id I am getting the info to show it on the page. Can someone please suggest an alternative approach to this thanks
4 Replies
lee
lee11mo ago
You can make your own ids that are shorter or prettier, like an incrementing number or a short string. Add an index on the new id for fast lookup.
Abhishek
AbhishekOP11mo ago
will that be as fast as db.get ?
lee
lee11mo ago
Yes, under the hood db.get is just an indexed query
Abhishek
AbhishekOP11mo ago
Thanks @lee

Did you find this page helpful?