Connection.prototype.models
Type:
- «property»
A POJO containing a map from model names to models. Contains all models that have been added to this connection using Connection#model()
.
Example
const conn = mongoose.createConnection();
const Test = conn.model('Test', mongoose.Schema({ name: String }));
Object.keys(conn.models).length; // 1
conn.models.Test === Test; // true
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .