猫鼬的遗传

Eri*_*rik 15 javascript inheritance mongoose node.js express

您好我需要在mongoose库中继承我的模式.那有完整的插件吗?或者我应该如何做到这一点?

我还需要从Base模式继承所有pre,post,init中间件.

reg*_*low 16

对于寻找此功能的其他人,Mongoose 3.8现在具有通过Discriminator功能的Schema Inheritance:

https://github.com/LearnBoost/mongoose/pull/1647


hun*_*tis 15

您可能想看看使用Mongoose插件:

一个可以"开箱即用"的插件就在这里: