📜  芒果连接 - Javascript 代码示例

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

代码示例1
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/test', {useNewUrlParser: true, useUnifiedTopology: true});

const Cat = mongoose.model('Cat', { name: String });

const kitty = new Cat({ name: 'Zildjian' });
kitty.save().then(() => console.log('meow'));