gpt4 book ai didi

mongodb - mongo bson objectid

转载 作者:可可西里 更新时间:2023-11-01 09:59:51 28 4
gpt4 key购买 nike

好奇 BSON::ObjectId.id.data 数组代表什么?

例如 [77, 145, 20, 13, 225, 96, 124, 5, 31, 0, 0, 1]

最佳答案

BSON::ObjectId.id.data 表示12字节的objectId。
以下是每个字节的确切含义:

0123   456     78   9 10 11
^^ ^^ ^^ ^^
time machine pid inc

A BSON ObjectID is a 12-byte value consisting of a 4-byte timestamp (seconds since epoch), a 3-byte machine id, a 2-byte process id, and a 3-byte counter. Note that the timestamp and counter fields must be stored big endian unlike the rest of BSON. This is because they are compared byte-by-byte and we want to ensure a mostly increasing order.

ObjectId documentation

关于mongodb - mongo bson objectid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5467446/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com