I'm facing an issue when trying to connect to a database using mongoose.
The problem arises when I execute this code
var mongoose = require('mongoose').Mongoose;
var db = mongoose.connect('mongodb://localhost/goaljuice');
Upon running the above code, I encounter the following error message:
TypeError: Object function Mongoose() {
this.connections = [];
this.plugins = [];
this.models = {};
this.modelSchemas = {};
this.options = {};
this.createConnection(); // default connection
} has no method 'connect'
==================================
Here is the folder structure of my project:
-express_example
--app.js
--node_modules
------express, jade, mongodb, mongooses, stylus
--public
--router
--views