Defer commitment to the ORM. Separate your domain models from your persistence models.
const compose = require('mongoose-plugin-compose').default;
class Animal {
speak(){
console.log(this.name)
}
}
const Cat = mongoose.model('Cat', new mongoose.Schema({
name: String
}));
Cat.schema.plugin(compose(Animal));
const cat = new Cat({ name: 'fido'});
cat.speak(); // fido