Mongoose SchemaType.prototype.ref() API
The MongooseSchemaType.ref() method of the Mongoose API is used to build relationships between two Schema based on Objects Id's. We can set the reference of a modal using Modal Name, Modal Class, Function that returns Modal Name, and Function that returns Modal Class. We can access the ref() method