Answers for "what is mongoose node.js"

6

mangoosejs

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'));
Posted by: Guest on May-01-2020
1

node js + mongoose

await mongoose.connect('mongodb://localhost/my_database', {  useNewUrlParser: true,  useUnifiedTopology: true});
Posted by: Guest on August-02-2020

Code answers related to "what is mongoose node.js"

Browse Popular Code Answers by Language