Create ObjectId from a number.
A number.
Instead, use static createFromTime()
to set a numeric value for the new ObjectId.
Create ObjectId from a 24 character hex string.
A 24 character hex string.
Create ObjectId from the BSON ObjectId type.
The BSON ObjectId type.
Create ObjectId from the object type that has the toHexString method.
The ObjectIdLike type.
Create ObjectId from a 12 byte binary Buffer.
A 12 byte binary Buffer.
To generate a new ObjectId, use ObjectId() with no argument.
Implementation overload.
Optional
inputId: string | number | Uint8Array | ObjectId | ObjectIdLikeAll input types that are used in the constructor implementation.
Static
cacheThe ObjectId bytes
Compares the equality of this ObjectId with otherID
.
ObjectId instance to compare against.
Static
createStatic
createStatic
createStatic
generateStatic
isChecks if a value can be used to create a valid bson ObjectId
any JS value
Generated using TypeDoc
A class representation of the BSON ObjectId type.