📜  mongoose 使用统一拓扑 - Javascript 代码示例

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

代码示例1
// source: https://mongoosejs.com/docs/migrating_to_6.html#no-more-deprecation-warning-options

// No longer necessary:
mongoose.set('useFindAndModify', false);

await mongoose.connect('mongodb://localhost:27017/test', {
  useNewUrlParser: true, // <-- no longer necessary
  useUnifiedTopology: true // <-- no longer necessary
});