Answers for "npm mongo"

4

mongodb npm

npm install -g mongodb

npm install -g mongoose
Posted by: Guest on April-14-2020
-1

mongoose npm

const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/my_database', {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useFindAndModify: false,
    useCreateIndex: true
  })
  .then(()=> console.log('connect'))
  .catch((error) => console.error(error));
Posted by: Guest on October-16-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language