Complicated issue, and one that I doubt many people have to run into... but I'm trying to manage schemas dynamically post-runtime, as in update/replace schemas that have already been loaded. Basically an app that lets you create, register, and later update schemas (to then populate). Of course, trying to redefine a schema that's already been registered results in this error:
OverwriteModelError: Cannot overwrite [myModelName] model once compiled.
Is there any way to destroy a mongoose Model/Schema once it's been created? I've checked the API docs and searched for answers to no avail. Creating new schemas on the fly works like a champ - but updating them throws me against the brick wall.
Would rather not fork mongoose to add this functionality if I can at all help it :)
Thanks for any help!