How does Query.prototype.cast() work in Mongoose ?
The Query.prototype.cast() function casts this query to the schema of the model. And if the obj is present, then it is casted instead of this query.Syntax: Query.prototype.cast() Parameters: This function has one parameter i.e. the model to cast and if not set, then the default is this.model.Return