Create ObjectId from a number.
A number.
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 | ObjectId | ObjectIdLike | Uint8Array<ArrayBufferLike>All input types that are used in the constructor implementation.
The ObjectId bytes
A class representation of the BSON ObjectId type.