A
A
alexeymo2014-12-02 11:55:32
MongoDB
alexeymo, 2014-12-02 11:55:32

What is the best way to show MongoDb ObjectId in url?

Good afternoon. Please tell me, is it normal (safe) to show a url like somedomain/article/547c42c5bedf0b60575439c0/, where 547c42c5bedf0b60575439c0 is an ObjectId from MongoDb?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2014-12-02
@alexeymo

First link on google stackoverflow.com/questions/8561485/are-ids-object...

A
Alexander, 2015-04-29
@AlexanderKot

There is a book about mongodb in Russian Kyle Banker "MongoDB in action" 2012 , it describes on the 96th page how not to show id in the url.
In short, the point is that you simply make an additional field for the object (in the book it is called slug) and write some human-readable text in Latin without spaces into it, show it in the URL. It turns out somedomain/article/kak_ya_izuchal_mongo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question