Skip to content

Type Casters Utility ​

TypeCasters provides utility functions for converting strings or other types into MongoDB-compatible types (like ObjectId).

API Reference ​

const TypeCasters: object

Type casting functions for MongoDB types

Type declaration ​

NameTypeDefault value
Date()(dateValue) => Date-
ObjectIdObjectIdConstructormongoose.Types.ObjectId