BSONObjectID utilities
Attributes
- Companion
- class
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BSONObjectID.type
Members list
Value members
Concrete methods
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.
Value parameters
- fillOnlyTimestamp
-
if true, the returned BSONObjectID will only have the timestamp bytes set; the other will be set to zero.
Attributes
Generates a new BSON ObjectID using the current time as seed.
Tries to make a BSON ObjectId from a hexadecimal string representation.
Tries to make a BSON ObjectId from a hexadecimal string representation.
Attributes
Tries to make a BSON ObjectId from a binary representation.
Tries to make a BSON ObjectId from a binary representation.
Attributes
Returns the string representation for the given BSONObjectID.
Extracts the bytes if that
's a BSONObjectID.