📌  相关文章
📜  mongoose 连接到 mongodb - Javascript 代码示例

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

代码示例6
// local conecation

const mongoose = require("mongoose");

mongoose
  .connect("mongodb://localhost:27017/testdb")
  .then(() => console.log("Connected to MongoDB..."))
  .catch((err) => console.error("Could not connect to MongoDB...", err));