📜  mongodb npm - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:30.059000             🧑  作者: Mango

代码示例2
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/my_database', {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useFindAndModify: false,
    useCreateIndex: true
  })
  .then(()=> console.log('connect'))
  .catch((error) => console.error(error));