📜  Node.JS mongodb 创建数据库 - Javascript 代码示例

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

代码示例1
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/mydb";

MongoClient.connect(url, function(err, db) {
  if (err) throw err;
  console.log("Database created!");
  db.close();
});