【发布时间】:2019-07-27 10:22:56
【问题描述】:
所以我试图了解如何在 Mongo 中创建 ObjectId,我发现 this 页面描述了它:
a 4-byte value representing the seconds since the Unix epoch,
a 5-byte random value, and
a 3-byte counter, starting with a random value.
由于时间戳,这是否意味着即使将具有相同确切内容的文档插入到数据库中也会被分配两个不同的“ObjectId”?
即。这?
db.Collection.insert({'field one' : 'example'} # ObjectID = X
db.Collection.insert({'field one' : 'example'} # ObjectID = Y
【问题讨论】: