CampbellSoftwareSolutions / mongoose-id-validator

Mongoose plug in to validate ObjectID references point to valid existing documents.
Other
47 stars 26 forks source link

Support Schema references as Model #41

Open trovafer opened 3 years ago

trovafer commented 3 years ago

Mongoose permits Schema references to be set as String or Model. https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-ref

This change is to support both scenarios.

LSafer commented 2 years ago

Never mind, I created https://github.com/lsafer/mongoose-extra-validators to address the issue