Create an ObjectId type
Can be a 24 character hex string, 12 byte binary Buffer, or a number.
The ObjectId bytes
The ObjectId bytes
Compares the equality of this ObjectId with otherID
.
ObjectId instance to compare against.
Returns the generation date (accurate up to the second) that this ID was generated.
Returns the ObjectId id as a 24 character hex string representation
Converts to its JSON the 24 character hex string representation.
Converts the id into a 24 character hex string for printing, unless encoding is provided.
hex or base64
Creates an ObjectId instance from a base64 string
Creates an ObjectId from a hex string representation of an ObjectId.
create a ObjectId from a passed in 24 character hexstring.
Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.
an integer number representing a number of seconds.
Generate a 12 byte id buffer used in ObjectId's
pass in a second based timestamp.
Checks if a value is a valid bson ObjectId
ObjectId instance to validate.
Generated using TypeDoc
A class representation of the BSON ObjectId type.