📜  mangoosejs - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:41.047000             🧑  作者: 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'));