Creates a new ObjectId instance.
If id is provided, it must be a 24-character hex string. Otherwise, a new ObjectId is generated.
Optional id: null | string | number | ObjectIdThe ObjectId string.
Whether to validate the ObjectId string. Defaults to true.
Private Readonly _rawImplementation of $SerializeForCollection for TableCodec
Errorful implementation of $SerializeForTable for TableCodec
Throws a human-readable error message warning that this datatype may not be used with tables without writing a custom ser/des codec.
Compares this ObjectId to another ObjectId.
The other ObjectId can be an ObjectId instance or a string.
An ObjectId is considered equal to another ObjectId if their string representations are equal.
The ObjectId to compare to.
true if the ObjectIds are equal, false otherwise.
Static [$Implementation of $DeserializeForCollection for TableCodec
Represents an ObjectId that can be used as an _id in the DataAPI.
Provides methods for generating ObjectIds and getting the timestamp of an ObjectId.
Example
Example