📜  node.js 中的猫鼬 - Javascript 代码示例

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

代码示例2
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'));