Constructors
constructor
- new ObjectId(inputId?: string | number | ObjectId | Uint8Array | Buffer | ObjectIdLike): ObjectId
Parameters
Optional inputId: string | number | ObjectId | Uint8Array | Buffer | ObjectIdLike
Properties
_bsontype
_bsontype: "ObjectId"
generationTime
generationTime: number
id
id: Buffer
Static cacheHexString
cacheHexString: boolean
Methods
equals
- equals(otherId: string | ObjectId | ObjectIdLike): boolean
Parameters
otherId: string | ObjectId | ObjectIdLike
Returns boolean
getTimestamp
Returns Date
inspect
Returns string
toHexString
Returns string
toJSON
Returns string
toString
- toString(format?: string): string
Parameters
Returns string
Static createFromHexString
- createFromHexString(hexString: string): ObjectId
Parameters
Static createFromTime
Parameters
Static generate
- generate(time?: number): Buffer
Parameters
Returns Buffer
Static isValid
- isValid(id: string | number | ObjectId | Uint8Array | Buffer | ObjectIdLike): boolean
Parameters
id: string | number | ObjectId | Uint8Array | Buffer | ObjectIdLike
Returns boolean
A class representation of the BSON ObjectId type.