📜  使用 express js 连接猫鼬 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:16.290000             🧑  作者: Mango

代码示例2
//connect with mongodb
mongoose.connect('mongodb://localhost:27017/your_db_name', {useNewUrlParser: true});
//you can also specify with user and pass
mongoose.connect('mongodb://username:password@host:port/database?options...', {useNewUrlParser: true});
//or goto docs https://mongoosejs.com/docs/connections.html