const mongoose = require('mongoose');
mongoose.connect( 'mongodb://127.0.0.1:27017/eggcms', {useNewUrlParser: true});
var UserSchema =new mongoose.Schema({
name:String,
age:Number
})
var User = mongoose.model('User',UserSchema,'user')
User.updateOne({name:"李四"},{name:"chengchao"},(err,doc)=>{
if(err) throw err;
console.log(doc)
})