0

I am using PHP + MongoDB. Is it possible to have shorter Id for a record or shorter unique Id for a record? When I use Id in URL, it is too long. I want it to be shorter. Please advice.

user2987836
  • 1,543
  • 2
  • 10
  • 8

1 Answers1

1

As rightly said by @sevenseacat, the ObjectIDs can't be cut short.

Instead, you can always override your _id value to a user-defined number or string. This would allow you to have a smaller value that you can pass in a URL.

jmikola
  • 6,892
  • 1
  • 31
  • 61
Hannan Shaik
  • 1,298
  • 2
  • 14
  • 27