Installing MongoDB

suggest change
npm install --save mongodb
npm install --save mongoose //A simple wrapper for ease of development

In your server file (normally named index.js or server.js)

const express = require('express');
const mongodb = require('mongodb');
const mongoose = require('mongoose');
const mongoConnectString = 'http://localhost/database name';

mongoose.connect(mongoConnectString, (err) => {
  if (err) {
    console.log('Could not connect to the database');
  }
});

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents