mongodburlhashkeystonejskeystone

Removing/ hiding Mongo ObjectID from the KeystoneJS URL


Is there any way to remove or hide the mongo Object ID from the URLs generated by the Keystone.js website.

Example:

When I try to go to any product posted using the CMS admin from the website I can see the exact same MongoID (_id) of that document attached with the URL:

http://abc.def/xyz/58a6d7eb177b563c595683ba


Solution

  • Thanks for your responses.

    I have solved this issue by giving the unique "key" relation in the keytone.js and used the same "key" as navigation in URLs. By doing that, we just had to change the relationship of objectIDs to keys and everything started working fine without the objectIDs in the URLs.