📜  mongodbClint express - Javascript 代码示例

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

代码示例2
var MongoClient = require('mongodb').MongoClient

MongoClient.connect('mongodb://localhost:27017/animals', function (err, db) {
  if (err) throw err

  db.collection('mammals').find().toArray(function (err, result) {
    if (err) throw err

    console.log(result)
  })
})