@kyanny's blog

My thoughts, my life. Views/opinions are my own.

MongoDB の ObjectId が 6 始まりになっていた

MongoDB Memo Issue 78: January 22, 2021 より。

MongoDB ObjectIds Now Start with 6 — This is pointless trivia, but ObjectIds are formed from Unix epoch timestamp values plus a random value and a incrementing counter. Due to the current time since 1970, ObjectIds now start with 6 rather than 5. You’ll need to wait till 2029 until the 7s begin. Generate some ObjectIds here!

WES BOS ON TWITTER

仕事で7年間 MongoDB を使ってた間はずっと 5 始まりの ObjectId だったので、ちょっと感慨深い。

> ObjectId()
ObjectId("600fd00472eee4f6d36eea55")