You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i think it would be less error prone to have an option for passing the model to a function, without having the need for extending all the mongoose types.
e.g. i have my models in a different package than the schema-creation script. now i need to include mongoose, for schema creation and it seems, there is something off with peerDependencies or so, because the .jsonSchema function does not exist.
yes, this... I use shared mongoose libraries, so the Models are instantiated through a provided mongoose connection...
Can't seem to find the right way to ensure the JsonSchema function is added to the model...
I tried
module.exports = function connectionFactory(connection) {
logger.trace(`transactionLog model connection ${connection.id}`);
extendMongooose(connection);
return connection.model('TransactionLog', transactionLogSchema);
};
But that results in
TypeError: Cannot destructure property 'Types' of 'mongoose.Schema' as it is undefined.
i think it would be less error prone to have an option for passing the model to a function, without having the need for extending all the mongoose types.
e.g. i have my models in a different package than the schema-creation script. now i need to include mongoose, for schema creation and it seems, there is something off with peerDependencies or so, because the .jsonSchema function does not exist.
so instead of
i would like to do:
The text was updated successfully, but these errors were encountered: