Mongoose.prototype.connections
Type:
- «Array»
An array containing all connections associated with this Mongoose instance. By default, there is 1 connection. Calling createConnection()
adds a connection to this array.
Example:
const mongoose = require('mongoose');
mongoose.connections.length; // 1, just the default connection
mongoose.connections[0] === mongoose.connection; // true
mongoose.createConnection('mongodb://localhost:27017/test');
mongoose.connections.length; // 2
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .