title: ReferenceError: mongoose is not defined
body: <p>I am getting ReferenceError: mongoose is not defined. I am new to node please App.js code is below is as shown below. I am not able to solve it by all the answers provided in google.</p>
  
  <pre><code>   var express = require('express');
   var app = require('mongoose');
   var path = require('path');
   var favicon = require('serve-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser'); 
  var bodyParser = require('body-parser');
  
   var index = require('./routes/index');
  var users = require('./routes/users');
  var app = express();
  app.set('views', path.join(__dirname, 'views')); 
     app.set('view engine', 'jade');
  
   app.use(logger('dev'));
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({ extended: false }));
     app.use(cookieParser());
   app.use(express.static(path.join(__dirname, 'public')));
  
   app.use('/', index);
   app.use('/users', users);
   app.use(function(req, res, next) {
   var err = new Error('Not Found');
    err.status = 404;
    next(err);
    });
  
    mongoose.connect('mongodb://localhost:27017/mydb');
  
    var Schema = new mongoose.Schema({
    cr   : String,
  
          });
  
         var user = mongoose.model('myc', Schema);
  
      app.get('/view', function(req, res){
       user.find({}, function(err, docs){
        if(err) res.json(err);
      else    res.render('index', {users: docs});
        });
               });
  
  
        app.use(function(err, req, res, next) {
  
      res.locals.message = err.message;
       res.locals.error = req.app.get('env') === 'development' ? err : {};
  
      res.status(err.status || 500);
     res.render('error');
    });
  
   module.exports = app;
  </code></pre>
  
  <p>I am using node version6.11.0 and npm v 5.5.1
  How to resolve this? pleas help</p>