Mongoose.prototype.connection
Type:
- «Connection»
The Mongoose module’s default connection. Equivalent to mongoose.connections[0]
, see connections
.
Example:
const mongoose = require('mongoose');
mongoose.connect(...);
mongoose.connection.on('error', cb);
This is the connection used by default for every model created using mongoose.model.
To create a new connection, use createConnection()
.
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .