Joel.Watson92@gmail.com | LinkedIn: /in/joel3rbear | Twitter: @Joel3rBear
One use-case where param middleware would come in handy would be authentication middleware run whenever the id token is supplied as a param.
The two ways to add middleware between Mongoose and MongoBD interactions are by using the pre or the post hooks.
A join by reference differs from a virtual join in that the join by reference is actually defined in the schema itself as a field of the object of the ObjectID type. In a virtual join, the options are given to the schema to allow virtuals and then below the schema, you set up your virtual field.
The localField and foreignField are used to tell the virtual join which field in the local table (localField) should match to which field in the remote table (foreignField).