Explanation
Mongoose allows the field ref to be any of:
- string
- model
- a function that returns string
- a function that returns model
Expected Behavior
When ref is a function, the plugin executes the function
When ref is a model, the plugin takes the name of the model
Actual Behavior
The plugin uses the toString function the value on ref to get the collection name
Explanation
Mongoose allows the field
refto be any of:Expected Behavior
When
refis a function, the plugin executes the functionWhen
refis a model, the plugin takes the name of the modelActual Behavior
The plugin uses the
toStringfunction the value onrefto get the collection name