My learning diary

Numerical IDs in MongoDB

Auto-generated IDs in MongoDB are “strange” strings. I quote “strange” because they are actually derived not out of nowhere despite looking like they had nothing to do with anything. But to users, these IDs are strange. I had a collection of documents with a name property. Originally, name was annotated with @Id. But it meant that I could not change the value of name. name was also annotated with regex validation (@Pattern(.

Continue reading "Numerical IDs in MongoDB"