mongoose
const mongoose = require('mongoose'); const Schema=mongoose.Schema; mongoose.connect("mongodb://47.93.52.112:27017/myDb", function(err) { console.log('MongoDB 连接成功'); const stuSchema = new Schema({name:String, age:Number}); const stu = mongoose.model('stu', stuSchema); stu.find().then(function (docs) { console.log(docs) }) })