Generates a new BSON ObjectID from the given timestamp in milliseconds.
Generates a new BSON ObjectID from the given timestamp in milliseconds.
The included timestamp is the number of seconds since epoch, so a BSONObjectID time part has only a precision up to the second.
To get a reasonably unique ID, you _must_ set onlyTimestamp
to false.
Crafting an ID from a timestamp with fillOnlyTimestamp
set to true
is helpful for range queries; e.g if you want of find documents an _id
field which timestamp part is greater than or lesser
than the one of another id.
If you do not intend to use the produced BSONObjectID
for range queries, then you'd rather use the generate
method instead.
if true, the returned BSONObjectID will only have the timestamp bytes set; the other will be set to zero.
Generates a new BSON ObjectID using the current time as seed.
Generates a new BSON ObjectID using the current time as seed.
Tries to make a BSON ObjectId from a binary representation.
Tries to make a BSON ObjectId from a hexadecimal string representation.
Returns the string representation for the given BSONObjectID.
Returns the string representation for the given BSONObjectID.
Extracts the bytes if that
's a BSONObjectID.
BSONObjectID utilities